Fibonacci Series in Python

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

Комментарии • 64

  • @GirlCodingpro
    @GirlCodingpro Год назад +76

    One day before exam watching this 😅

  • @mukeshC164
    @mukeshC164 2 года назад +31

    Wow amazing job explaining this concept, I was literally struggling for hours till I watched your videos. Thank you thank you thank you….

    • @the_pykid
      @the_pykid 2 года назад

      Same, this was very informative and helpful

  • @maikerstanleycanongarces164
    @maikerstanleycanongarces164 Год назад +2

    his english is very wonderful

  • @iqamifthi9745
    @iqamifthi9745 Год назад +5

    Clear explanation!

  • @Anaghv-nh9zu
    @Anaghv-nh9zu 4 месяца назад +1

    Can we do it using while loop?

  • @haniboutlat3711
    @haniboutlat3711 2 года назад +8

    But what if your startValue is not 0 and 1, your start value can be any term.. We can then use it as a variable but how to then print it out? I am stuck with this for about 3 days now.

    • @king_speedyamv8498
      @king_speedyamv8498 2 года назад +1

      A Fibonacci Sequence almost always starts with 0 as to reach other numbers(such as 8:0,1,1,2,3,5,8)
      If your starting number is not 0, and starts with x(as long as x is another number in the Fibonacci Sequence),then label n1 as x,and n2 as the number that comes after x in the Fibonacci Sequence.

    • @king_speedyamv8498
      @king_speedyamv8498 Год назад

      Same code but with user input

    • @king_speedyamv8498
      @king_speedyamv8498 Год назад +3

      Num = int(input("Enter no. of terms - "))
      if Num < 0:
      print("Enter a value greater than 0!")
      if Num > 0:
      a = int(input("Enter a number from the Fibonacci Sequence : "))
      b = int(input("Enter a number succeeding the first no. :"))
      c= 0
      for x in range(Num):
      print(c,end=" ")
      c = a + b
      a = b
      b= c

  • @allucreation622
    @allucreation622 Год назад +2

    Plz do more videos like this in python topic this is bca students request

  • @shree9320
    @shree9320 8 месяцев назад

    brilliant explanation

  • @BaldevPurohit
    @BaldevPurohit Год назад +1

    nicely explained.. thanks

  • @shadow.7248
    @shadow.7248 2 года назад +5

    Thank you so much Sir!

  • @aryashukla4632
    @aryashukla4632 3 года назад +4

    Sir plz tell where are you writing this code???? Which where on idle?

    • @TheProgrammingPortal
      @TheProgrammingPortal  3 года назад +6

      Hi, this code is written in Pycharm IDE which is freely available on their site.

    • @aryashukla4632
      @aryashukla4632 3 года назад +1

      @@TheProgrammingPortal tysm

  • @RexLapis-h5k
    @RexLapis-h5k Год назад

    makasih bang the programming portal aku tadi disuruh menulis beginian ama guruku tetapi saat kau muncul di beranda ku aku tertolong sekali

  • @sports18927
    @sports18927 Год назад

    Great video

  • @the_pykid
    @the_pykid 2 года назад +4

    This was a great video!

  • @HousseinAlDroubi
    @HousseinAlDroubi 4 месяца назад

    Hi man, welcome to you.

  • @kishoretummala3259
    @kishoretummala3259 Год назад +2

    First equal to should be==like

  • @jinwoo6757
    @jinwoo6757 2 года назад +1

    sir why didn't we took n+1 cause 7 will not be taken in range

    • @TheProgrammingPortal
      @TheProgrammingPortal  2 года назад +1

      Hi, n+1 not taken as we need to print upto n terms, and we started with 0.
      Eg. Print 7 fibo series, start with 0 to 6

    • @jinwoo6757
      @jinwoo6757 2 года назад

      @@TheProgrammingPortal thanks sir

  • @jayasurya225
    @jayasurya225 6 месяцев назад

    Sir I will print some range by using forloop it will not print

    • @TheProgrammingPortal
      @TheProgrammingPortal  6 месяцев назад

      Hi, are you trying to run the same code explained in the video? Can you check the code once and share the error

  • @Irfana-gm3lk
    @Irfana-gm3lk 10 месяцев назад +1

    4 Hrs before the exam watching this😂

  • @niha1398
    @niha1398 Год назад

    it is great

  • @AnujAryavart77
    @AnujAryavart77 11 месяцев назад

    Watching this video before 2 hours of exam

  • @JayshreeRam-772
    @JayshreeRam-772 3 года назад +11

    It's hard

  • @Abdullahekeje
    @Abdullahekeje 2 года назад +2

    Our teacher took 2 hours to do this 😅

  • @GowthamKumar-vv8bq
    @GowthamKumar-vv8bq 8 месяцев назад

    Todays exam me watching before exam😅

  • @test-y1p7r
    @test-y1p7r 3 года назад

    Smart guy!!!!

  • @IITian_Dr_Yash027
    @IITian_Dr_Yash027 3 года назад

    sir i have difficulty in line 7
    what is meanung of range
    (0 , end " ")

    • @TheProgrammingPortal
      @TheProgrammingPortal  3 года назад +7

      range (0, num) helps to generate sequence of number from 0 to n.. eg. range (0,5) will give 0, 1,2,3,4 .. in next print statement.. end parameters defines what to print after number ..In this example end=" " will add blank space after printing sum.
      Hope this helps.

  • @noob_AKgaming
    @noob_AKgaming Год назад

    App name please

  • @bernardnwafor7943
    @bernardnwafor7943 3 года назад

    thanks alot

  • @kritikaanand4931
    @kritikaanand4931 2 года назад

    🤩🤩

  • @AbdulWahid-fq5ft
    @AbdulWahid-fq5ft 2 года назад +11

    What is the logic of this code

  • @siddikshahriar3092
    @siddikshahriar3092 2 года назад

    How do i do it for nth position after taking n number?

    • @TheProgrammingPortal
      @TheProgrammingPortal  2 года назад +1

      Hi,
      You can pass n in defined parameters and use recursive approach or use loop and sum the fibonaccies.
      and return final sum.
      Hope this overview helps you.

  • @Accuracy321
    @Accuracy321 2 года назад +1

    Hi sir should I subscribe to you???? Explain.

  • @AKASHSINGH-zr6yg
    @AKASHSINGH-zr6yg 3 года назад +1

    Hi

  • @Myself_Irin
    @Myself_Irin 6 месяцев назад

    Tomorrow's my ai exam

  • @jeejwala
    @jeejwala Год назад

    Syntax error aa rha hai

    • @TheProgrammingPortal
      @TheProgrammingPortal  Год назад

      What syntax error are you getting? Please validate the code once. Also, check any indention error or something else.

  • @ankitsindoriya4274
    @ankitsindoriya4274 2 года назад +4

    n=int(input("enter your number")
    X=0
    Y=1
    Z=0
    For i in range(n):
    x+y
    y+z
    Z=x+y
    Print (z)
    Run

    • @praveenk6206
      @praveenk6206 2 года назад +1

      n=int(input("enter your number"))
      x=0
      y=1
      z=0
      for i in range(n):
      print(z)
      x=y
      y=z
      z=x+y

    • @VinothKumar-kk7ct
      @VinothKumar-kk7ct 2 года назад

      did not work