write a Python program that prompts the user for an integer between 1 and 20…

16.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

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.

  • Program-2.zip