Python While Loops & For Loops | Python tutorial for Beginners

preview_player
Показать описание

Learn Python While Loops & For Loops in this Python tutorial for beginners. Loops help us iterate through blocks of code that we need to repeat. This works especially well when working with collections of data.

⭐ Become a full-stack dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

Python While Loops & For Loops | Python tutorial for Beginners

(00:00) Intro
(00:05) Welcome
(00:13) Quick Setup
(00:48) Basic While Loop
(02:18) Break Statements
(03:00) Continue Statements
(04:35) Else Statements
(05:40) Basic For Loop
(06:47) Looping Through a String
(07:20) For Loop with a Break
(08:06) For Loop with Continue
(08:46) Looping Through a Range of Numbers
(09:24) Range Start and End
(10:27) Range Increment Values
(11:31) For Loop with Else
(11:58) Nested Loops
(15:15) Improving RPS with a loop

📚 Tutorial References:

Was this Python While Loops & For Loops tutorial for beginners helpful? If so, please share. Let me know your thoughts in the comments.

#python #while #loops
Рекомендации по теме
Комментарии
Автор

I like how I am able to solve little problems on my own thanks to your sensible teaching Dave a little progress everyday goes a long way, progress over perfection

tbdjkmp
Автор

Just wanted to say thanks for the awesome content on your YouTube channel! I'm learning a lot from you and it's really cool to see kind-hearted people like you out there. Keep up the great work!

siavoshoon
Автор

Amazing Dave! You are relentless 💪
Congrats on the 150k subs, very deserving of such and more.

doors
Автор

Thank you for the video. One of the hardest thing about coding for me is the order in which you type things out like you mention in the continue section (3:40) I wish more teachers would focus on that

Omer
Автор

11:45 no need to escape the apostrophe since it is enclosed in double quotes.

ronwbrown
Автор

Never give up, you deserve more subscribers

dickschweiger
Автор

11:56 you don't need to escape the ' print("glad that's over") or print(' another "example" ')

consciencedimension
Автор

5:18 i believe int's can be printed. I think the problem here is that you tried to CONCAT an int to a string, not that you tried to print an int.

johnaweiss
Автор

4:35 So, the `else` is executed when the while finishes. `break` will skip past anything in the `else`, correct? Therefore, if there's no break statement in the while loop, then anything in the `else` could be place completely AFTER the entire `while` block -- it will get executed just the same. CORRECT?

johnaweiss
Автор

"When you use the variable name 'playagain' for both the loop condition and the 'play again' input, declaring the variable with the same name 'playagain, ' it is working due to a truthy value. However, is this considered good practice?"

rokib
Автор

It’s a little unfortunate to reuse the ”playagain” variable as the input destination. It certainly illustrates that the ”continue” statement doesn’t evaluate the ”while” condition, but it might trip up a beginner in a different situation. Regardless, thoroughly enjoying this series, thanks for sharing!

PeranMe
Автор

dave_upload_video = True
while dave_upload_video:
if is_video_ends():
break
like()
comment()
if not is_subscribed():
subscribe()

willyhorizont