Python: While Loops (Reading User Input Indefinitely?!!)

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 11

  • @smokebeans3715
    @smokebeans3715 2 роки тому +5

    Great i understood nothing before, now i understand very little.. very helpful

  • @TheUssmkl
    @TheUssmkl 6 місяців тому

    This guy is a great teacher! I'm taking Programming Logic through college and it is confusing. After watching this Afternerd I get it!

  • @jessicabrauman
    @jessicabrauman Рік тому +2

    This is a great explanation, but I think adding the sum function makes it more confusing than it needs to be. It took me a while to understand this video to be honest.
    Maybe a better example would be something like:
    i = True
    while i == True:
    answer = input("Do you want to continue?"
    if answer == "Yes" :
    i = False
    print("End of loop")
    Please excuse any mistakes or weird formatting, I am very new to programming.

  • @calebmoughkera-65
    @calebmoughkera-65 11 місяців тому

    wow! thanks so much. the logic behind the while loop has been my problem until today.

  • @maharanirani54
    @maharanirani54 Рік тому

    Great explanation. Thank you!

  • @Gwenc22
    @Gwenc22 2 роки тому

    Very helpful explanation!

  • @amitvashishtha4158
    @amitvashishtha4158 2 роки тому

    Wow! Very nice.

  • @davidschrodinger2043
    @davidschrodinger2043 2 роки тому +1

    thank youu!

  • @tapansaha6624
    @tapansaha6624 2 роки тому

    Excellent..

  • @harunora13
    @harunora13 2 роки тому

    sum=0
    num = 0
    while num >=0:
    num=int(input("Enter a positive integer: "))
    if num >=0:
    sum +=num
    print(f"sum is {sum}")
    Sorry because i just started this, but doesnt this look more optimized than your code? Sorry for asking.

  • @alone0802
    @alone0802 Рік тому

    I have doubts in second code in while loop