Kristi W.

asked • 01/29/20

Even Odd Generator Python

I have to make a program where you input a number and it prints whether the number is even or odd and it must display the number followed by the next 9 even or odd numbers. The program must use the is_integer() method to display an error message. I have the basic output but I can not figure out how to get the error message. I have:

if a % 2 == 0:

    print('{0} is Even'.format(a))

    print(a, a+2, a+4, a+6, a+8, a+10, a+12, a+14, a+16, a+18)

else:

    print('{0} is Odd'.format(a))

    print(a, a+2, a+4, a+6, a+8, a+10, a+12, a+14, a+16, a+18)


1 Expert Answer

By:

John F. answered • 02/01/20

Tutor
0 (0)

Lawyer, Scientist, Programmer, and above all, Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.