Question: 1. Write a python program that will print out if a number is even or odd. Use a loop to print out all the numbers

1. Write a python program that will print out if a number is even or odd. Use a loop to print out all the numbers from 1 to 17 stating if it is odd or even.

  • Use a for() loop

Example:

1 is odd

2 is even

2. Write a python program that will list the first five prime numbers. A prime number is a number that can only be divided by itself and 1.

  • Use a while() loop

Example:

2

3

5

7

11

Help would be greatly appreciated, thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!