Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions odd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Function to print odd numbers using a for loop
def print_odd_numbers(start, end):
print(f"Odd numbers between {start} and {end}:")
for num in range(start, end + 1):
if num % 2 != 0:
print(num, end=' ')
print() # For a new line after printing

# Example usage
print_odd_numbers(1, 20)