Python 3 programming tutorial: While Loop

preview_player
Показать описание
The two distinctive loops we have in Python 3 logic are the "for loop" and the "while loop." Both of them achieve very similar results, and can almost always be used interchangeably towards a goal. Many times it comes down to programmer preference, or is reliant on efficiency. Generally, the for loop can be more efficient than the while loop, but not always.

The idea of the While loop is:
While something is the case, do the following block of code.

This Python 3.3 programming tutorial covers the while loop within Python.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

After this lesson you can get this joke)))
A programmer went to the grocery store. His wife said "while you are out, go get some milk"
He never came back.

angel-rmvg
Автор

lol thanks for showing me about the "wow" loop.

spacefentionz
Автор

THANK YOU!!! I've been looking everywhere to learn python and this is the longest, most audible, and easy to understand tutorial on YouTube. I'm recommending this to my friends

AdlerWeber
Автор

Awesome tuts!You really make Python look easier, simpler and more fun. I love your tutorials. You are the best. Keep up the great job!!!

fawziathkaraka
Автор

thank you for making these tutorials short and getting to the point.

wandareed
Автор

So glad I found your tutorials. I recommend all your videos to my friends who are starting to learn programming. You do an excellent job of teaching, keep up the good work!

jackmiller
Автор

This small amount of information, helped me ALOT. Thanks man, amazing teacher.

hemakesmoney
Автор

The while loop can also be useful for algorithms that will repeat an unknown number of times, such as factoring a number. Correct me if I'm wrong, but I would say calling them "interchangeable" with a for loop might be a little misleading. 'for' statements iterate over the elements of a sequence or iterable object whereas a while loop only executes if a condition is true. In C++ they are virtually interchangeable, but not so in Python, I think.

djleisheng
Автор

thank you this helped me with my Alternative assessment and idk why i dont understad it but you explained it fluently
u earned a sub!!

gilmarpambidjr.
Автор

I love python, it's so much easier than c++, it's great for both begginers and more advanced users. Also, you make a great job at explaining everything, you just won a new subscriber.

daboss
Автор

This video is helping me after 7 years also!thanks a lot bro!

lawlit
Автор

Really Nice and simple tutoriels to learn python. :) Thank You Very Much

baradanecovindassamy
Автор

I ligit love you right now. I can do my homework now. Thank you for existing.

joannakoman
Автор

Thank you so much for all the great tutorials.

pouryash
Автор

Thanks for this tutorial series. This is really saving me right now!!

Sank
Автор

Thanks for the Tutorial... Very simplified

ibekwevictor
Автор

print("She: Do you really love me?")
print("He: Yes, baby")
print("She: I want you to keep telling me that you love me till I die, baby")
print("He: Not a problem, baby")

# HE DID THIS:
while True:
print("I love you")

kazimahim
Автор

Thanks, I wasn't understanding what my teacher explained. This helps alot

_punpun_
Автор

Regarding the infinite while True loop - I've run it in Sublime and it didn't stop with CTRL+C. I just highlighted the code, deleted it (or CTRL+X if you like to re-use the code) and pressed CTRL+B.
That did the job for me lol

Love your tutorial! :)

blackgrizzly
Автор

It really bothers me that the incremental operator "++" is not allowed in python...

soulextracter