Python program to print all even numbers from 1 to 20

You can print all even numbers from 1 to 20 in Python using a loop. Here's a simple program to achieve that:

def print_even_numbers(start, end):

for num in range(start, end + 1):

if num % 2 == 0:

print(num)

# Example usage:

print("Even numbers from 1 to 20:")

print_even_numbers(1, 20)

```

This program defines a function `print_even_numbers` that takes the starting and ending numbers as parameters and prints all even numbers between them. Then, it calls this function with the range from 1 to 20 as arguments.