While loops in Python are easy ♾️

preview_player
Показать описание
#python #tutorial #course

# while loop = execute some code WHILE some condition remains true

00:00:00 intro
00:00:50 example 1
00:01:50 infinite loop
00:02:25 example 2
00:03:39 example 3
00:05:08 example 4
00:06:35 conclusion
Рекомендации по теме
Комментарии
Автор

#while loop = perform some code WHILE some condition remains true

# EXAMPLE 1

name = input("Enter your name: ")

while name == "":
print("You did not enter your name!")
name = input("Enter your name: ")

print(f"Hello {name}")

# EXAMPLE 2

age = int(input("Enter your age: "))

while age < 0:
print("Age can't be negative")
age = int(input("Enter your age: "))

print(f"You are {age} years old")


# EXAMPLE 3

food = input("Enter a food you like (q to quit): ")

while not food == "q":
print(f"You like {food}")
food = input("Enter another food you like (q to quit): ")

print("bye")

# EXAMPLE 4

num = int(input("Enter a # between 1 - 10: "))

while num < 1 or num > 10:
print(f"{num} is not valid")
num = int(input("Enter a # between 1 - 10: "))

print(f"You picked the number {num}")

BroCodez
Автор

You explained this so clearly. Easiest “while” video to understand for me thus far. Liked.

christopherbermudez
Автор

As a senior (citizen.) trying to learn Python on YT I must say this is the clearest explanation of while loops I have seen todate. Thank you so much.

thequestionsoffaith
Автор

Thank you very much, this is the first time I have actually completely understood how to implement a while loop without having to deal with infinite responses. Your video was great and helped a lot. Cheers

billalkhwaja
Автор

Thank you so much for this video! I have been stuck on while loops for two days. I understand it so much more now. You rock!

saturncosmos
Автор

This was the best explanation video so far that i found. And probably the best Coding based teaching YT I have came across.

pirunnyrkki
Автор

Your youtube channel has been real helpful, thank you!

jeanjuste
Автор

Thanks! This has been the best and easiest tutorial for me to understand 👏 The explanation is quit simple and clear to the point. 🔥

Iskm.
Автор

I've been working on this from months and you made me understand in minutes 😍

dhruvaraj
Автор

Wow. Thats what I needed!!!! I am learning and learning loops and anyway can't understand how it's works. Maybe now I will. Thanks Bro!
Now I need to find you video for for loop as well ;)

ssigitas
Автор

Thanks!! I stuck in while loop as well. Now I understand how it works.

focuz
Автор

man you explained this so clearly it makes me wonder why I’m having so much difficulty with it

crimsonphoenix
Автор

Finally, an easy explanation! Thank you!

LilJollyJoker
Автор

What an informative video!! I find this video super helpful with such clear explanations!! Thank yoou so much!

fluffypieee
Автор

Following from Uganda, This is the best explanation have received . finally understood while loops

abdulserwanga
Автор

simple yet very clear and easy to understand.. thank you so much

jameswilliam
Автор

Best Vid to understand the while Loop. Great job

lopexaaz.kitchen
Автор

You became my favourite coder and teacher💯❤️🤝😊

myeducationvlogs
Автор

thanks man, it looked so easy but it is actually tough when we learn it for the first time .

DyNaMiC_GG
Автор

Such a good video!! Thank you so much for this tutorial it helped a lot.

Dragonis