Skip to content

Commit

Permalink
Using range() to Iterate Over Numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
oneananda committed Oct 28, 2024
1 parent d0405c7 commit 98cdf9e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion 0010-For-Loops/for_loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,27 @@

print("For loops example")
print()
print("Iterating Over a List")


print("Iterating Over a List - start")
print()

FRUITS = ["banana", "apple", "orange"]

for fruit in FRUITS:
print(fruit)

print()
print("Iterating Over a List - finish")
print("======================================================")


print("Using range() to Iterate Over Numbers - start")
print()

for i in range(10):
print(i) # Print 10 numbers starting from 0 (0-9)

print()
print("Using range() to Iterate Over Numbers - finish")
print("======================================================")

0 comments on commit 98cdf9e

Please sign in to comment.