Description
part 1
Countdown and Factorial |
Prior to beginning this assignment, read Chapter 5: Loops and Chapter 6: Functions in the course text, and review the More Control Flow Tools (Links to an external site.) web page.
Students: Be sure to download and save a PDF version of your textbook for future reference. It will be used in later courses within your program, including the final, capstone course. Zybooks limits online access to your course textbooks to a 12-month period. (Zybook Download Instructions)
For this interactive assignment, you will continue to utilize loops and functions and write a Python program that asks the user for an integer (number) greater than 1. Once the user enters an integer, it should then allow the user to choose between the following two options:
- If 1 is entered, a countdown from that number to zero is printed.
- If 2 is entered, the factorial of the number is printed.
If the user inputs a number less than 1, your program should display a message informing the user that the program only accepts numbers greater than 1.
(Note: As a programmer, you should always consider telling the user what type of data the program is expecting before they attempt to enter that data.)
Once you have completed the program, take a screen shot of the completed functionality (including the input and the output) and save it in a Word document, along with the script.
In your initial post,
- Attach your Word document.
- Describe your process in developing the program
- PART 2
- For this discussion, you will utilize functions to provide a way to clear Pythons integrated development environment (IDLE) window. In your initial post, provide the function for achieving this task and explain the process of clearing the IDLE window. Discuss some challenges that you faced in accomplishing this task.Note: The “cls” and “clear” commands are used to clear a terminal (i.e., a DOS prompt or terminal window).