While loops in Python are easy ♾️
2024 ж. 13 Мам.
293 033 Рет қаралды
#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}")
thank u soo much bro for the video as well as the code here☝
Thank you for your efforts 🤩!!
You explained this so clearly. Easiest “while” video to understand for me thus far. Liked.
This*
@@buenolvrthus is grammatically correct here
@@buenolvr if it said this it would be incorrect. dafuq
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
This was the best explanation video so far that i found. And probably the best Coding based teaching YT I have came across.
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!
are u a computer
@@buenolvr 😂
you are really a Bro for teaching us while loop and making it looks so easy thanks !
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 ;)
Thank you for the easy and clear explanation! Loved it!
Thanks! This has been the best and easiest tutorial for me to understand 👏 The explanation is quit simple and clear to the point. 🔥
that explanation was so good I transcribed some of it for my notes verbatim!
I've been working on this from months and you made me understand in minutes 😍
Thanks!! I stuck in while loop as well. Now I understand how it works.
What an informative video!! I find this video super helpful with such clear explanations!! Thank yoou so much!
Following from Uganda , This is the best explanation have received . finally understood while loops
Finally, an easy explanation! Thank you!
Thanks for the help, much better than coursera's courses, and their explanation on loops in general. Subscribed!
Best Vid to understand the while Loop. Great job
man you explained this so clearly it makes me wonder why I’m having so much difficulty with it
The best video to explain the while loop ever
Such a good video!! Thank you so much for this tutorial it helped a lot.
Thank you to help us improve our programing
Thanks bro! You're helping me a lot
simple yet very clear and easy to understand.. thank you so much
Finally a video that explains it from scratch with easy examples rather than rocket science
bro, i love you. you literally did just saved me
This makes so much sense now. Thank you Bro Code.
Thank you for the clear explanation 🤩!!
Thank you! You're a great teacher!
Bro, i just spend a lot of time searching how to exit a while loop with one key and did not finding anything that make some sense to me and you explained it in six minutes, thanks a lot!
Beautiful! YOU ARE THE BEST!!!
You are one of the best tutor in youtube for Python tutorials.
i can show u a toutoriaalalaalal
This is the best explanation ive had
I now understand while loops better after watching this thank you
You became my favourite coder and teacher💯❤️🤝😊
its proggraming!!
You made it so easy . Thanks bro ❤
Big thank you for your excellent video!
thanks for teaching me the WoW loop :)
BEST TUTORIAL EVER! THANK YOU SO MUCH MY EXAM IS TOMMOROW
You are doing a great work
This was really an interesting video in term of learning python and whole the tutorial is really appreciated just for helping us giving detailed information........................................
Thank you very much now I'm learning data science course it will be more useful for me to understand the python programming language very easily
you are the only one in yt who explain correctly
I'm not even learning python, this is just good programming explanation, thank you!
This tutorial helped so much with understansding the for while loop
I've been in tech studies for long time but now I came to fully understand how while loop works
Thank you for making it simple.
Thanks man!! It's a good explanation
This is pretty fun, thanks!
Bro. Now this is bro code. You are a good teacher👌👌👌👌
in love! finally i understand while !!
This was great thank you.
This was fu***king awesome and understandable thank you so much ❤
thanks for making this easy to understand.
thanks to you i undrstand this while loop thank you so much
NICELU DONE BRO...❤
Thank you very much for doing this.
You are really a Master.
you saved some lives here
Best Bro 😀
good work bro!
thanks super helpful
I love you.. even this is not on Google.. thanks Bro Code
Thanks, Bro! ... Subscription is on the way!
Thanks bro 🤜
You explained soo clearly , i have a test tomorrow on this chapter and this video helped a lot , thankyou
good luck on your test. i got exam in jan coming up for coding in python.
This vid was soo easy and fun thanks
helpfull thanks :)
this was easy thanks bro
I've been finding it so difficult when it comes to while loops, you made this so easy thank you! But is it not necessary to use else: statement??
Not necessarily. if a while loop exits due to the condition being false, the upcoming lines of code will be executed. Loops can either be exited with the while condition being false, or with the help of 'break' #example: i=1 while i in range(6): print(i) i+=1 if i==6: break else: print("no break") In this code, since break is used to exit the loop, the else statement doesn't get executed. but if the if block is commented out, you could see that it runs the else statement after the loop gets exited.
you are awesome! thanks a lot!
Good one sir
love you bro👾
How can it be so easy!!! thanks a lot!
I finally understood while loops 🤣😄
awesome!!!! Thanks!!!!
Bro code > You just earned my sub
bro before ho definitely! 💪
Thanks man!!
thanks for making this video, name = input("Please enter your name and no symbols or number: ") while name.isalpha() == False: print("You have either enter a number or symbol in your name, please try again:") name = input("Please enter your name and no symbols or number: ") else: print(f"Hello there {name}, thank you for following instructions")
Hello everyone I want to know what type of note is he using for python please
Great 🎉
thank u very much
muuuch obliged
How would I use this in a def function?
So basically for example one if the user does not input their name, the while loop will keep asking for the user name until the condition is true and print out hello to the user
if you put the command again of asking names
nice video❤
Great
You need put this whole python videos to compilation so we know tools about python
thank u so much this video explained clear but can u help me explain why when i'm writing nested while not working ? please can u help please
Which code editor do you use?
you explained this 100000000000000000x better than the instructor on free code camp!! you rock!!!
Great vid
Brocode is really a big bro❤
Thanks a lot
what is the use of f string ?
How to rember everything in coding if i learn something new after a few weeks i'm alreading forgeting it
Try this---------------> age = int(input("Enter your age: ")) age = int(input("Enter your age: ")) while age < 0: print("Age can't be negative") age = int(input("Enter your age: ")) if age>100: print("Its not possible to live than that!") elif age
Thank you
why do we use f? can you explain?
What is an f string