Question
IN PYTHON Write a program named Stairs.py that prompts the user for a number of steps between 1 and 10 and then draws the steps
IN PYTHON
Write a program named
Stairs.py
that prompts the user for a number of steps between
1 and 10 and then draws the steps as shown below
How many steps(1-10)? 1
How many steps(1-10)? 4
You may assume that a minimum of 1 step and a maximum of 10 steps will be entered. You do not
need to do any error checking of the user input for this program. If the user enters something other than an integer, the program will "throw an exception." This behavior is fine for this program.
Design You must define at least two functions in your program. One of your methods must take at least one parameter. You must use at least one loop within the program as well.
Implementation
Be sure to define any necessary constant(s) rather than use magic numbers.
HINT: Use a for loop to output the correct number of spaces before each step other than the first
step. You may want to define a method
that outputs a given number of spaces.
0 2 2 2 0 2 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started