filmov
tv
For loops in Python are easy 🔁
![preview_player](https://i.ytimg.com/vi/KWgYha0clzw/maxresdefault.jpg)
Показать описание
#python #course #tutorial
00:00:00 iterate forwards
00:01:39 iterate backwards
00:02:15 step
00:02:44 iterate over a string
00:03:26 continue
00:04:19 break
00:04:35 conclusion
# for loops = execute a block of code a fixed number of times.
# You can iterate over a range, string, sequence, etc.
# ---------------- EXAMPLE 1 ----------------
for x in range(1, 11):
print(x)
# ---------------- EXAMPLE 2 ----------------
for x in reversed(range(1, 11)):
print(x)
print("Happy New Year!")
# ---------------- EXAMPLE 3 ----------------
for x in range(1, 11, 2):
print(x)
# ---------------- EXAMPLE 4 ----------------
credit_card = "1234-5678-9012-3456"
for x in credit_card:
print(x)
# ---------------- CONTINUE ----------------
for x in range(1, 21):
if x == 13:
continue
else:
print(x)
# ---------------- BREAK ----------------
for x in range(1, 21):
if x == 13:
break
else:
print(x)
00:00:00 iterate forwards
00:01:39 iterate backwards
00:02:15 step
00:02:44 iterate over a string
00:03:26 continue
00:04:19 break
00:04:35 conclusion
# for loops = execute a block of code a fixed number of times.
# You can iterate over a range, string, sequence, etc.
# ---------------- EXAMPLE 1 ----------------
for x in range(1, 11):
print(x)
# ---------------- EXAMPLE 2 ----------------
for x in reversed(range(1, 11)):
print(x)
print("Happy New Year!")
# ---------------- EXAMPLE 3 ----------------
for x in range(1, 11, 2):
print(x)
# ---------------- EXAMPLE 4 ----------------
credit_card = "1234-5678-9012-3456"
for x in credit_card:
print(x)
# ---------------- CONTINUE ----------------
for x in range(1, 21):
if x == 13:
continue
else:
print(x)
# ---------------- BREAK ----------------
for x in range(1, 21):
if x == 13:
break
else:
print(x)
For loops in Python are easy 🔁
For Loops in Python
Introduction to For Loops in Python (Python Tutorial #5)
Python For Loops - Programming for Beginners
For Loops in Python | Python for Beginners
Nested loops in Python are easy ➿
#21 Python Tutorial for Beginners | For Loop in Python
Python Tutorial for Beginners 7: Loops and Iterations - For/While Loops
💻Unlocking Python Loops: For, While, and Beyond!🗝️🐍 | Episode 4 | HOW TO | AJ AND DJ PRODUCTIONS✨...
While loops in Python are easy ♾️
6 Tips to write BETTER For Loops in Python
The Fastest Way to Loop in Python - An Unfortunate Truth
Python for loop ➰
For Loop in Python (So Easy to Understand) #9
For Loop in Python | Python Tutorials for Beginners #lec42
Python Loops Tutorial | Loops In Python | For Loop, While Loop and Nested Loop | Simplilearn
While Loops and For Loops in Python | Learning Python for Beginners | Code with Kylie #6
How do loops work in Python?
Python Programming Tutorial #6 - For Loops
For Loops | Python | Tutorial 22
More About For Loops in Python & Solutions to the Last 2 Problems (Python Tutorial #7)
#20 Python Tutorial for Beginners | While Loop in Python
For Loops in Python | Python Tutorial - Day #17
Difference between FOR LOOP and WHILE LOOP in Python programming | Python programming tutorial
Комментарии