[SOLVED] write a Python program that prompts the user for an integer between 1 and 20...

16.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

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.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.