Assuming that user will only input integer write a python


Assuming that user will only input integer, write a Python program that prompts the user for an integer between 1 and 20 inclusive and prints out a countdown of even number(s) from that number to 0 in one line (one print statement) with a space separator between the numbers.

For example, if the user inputs 9, the output will be: 8 6 4 2 0 Requirements:- Use a while loop as a part of the countdown- Use the continue control statement to skip odd numbers The program should check if the user has a valid input. Examples of invalid inputs are:- Negative integer- Zero- Integer greater than 20 If the input is invalid, indicate so with a print statement.Note: an input statement always returns a value of string type.Thus, you will need to use type-casting.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Assuming that user will only input integer write a python
Reference No:- TGS01589023

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)