Please write a program that creates steps. You are expected to take in a single positive integer which will be used as the number of steps in your stair case. The program only accepts integers greater than 0 and less than 500. If 0 is entered a message stating "Your staircase has no steps." and if the user enters a value greater than or equal to 500, a message stating "I can't build a staircase that tall." For all other values not within the valid range or not integers an "Invalid staircase size provided." will be displayed to the user. The program will always run only once for each user input.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Python

2 Python 3.8.2 Shell
-
File Edit Shell Debug Options Window Help
D64)] on win32
Type "help", "copyright", "credits" or "license ()"
" for more information.
>>>
How many steps do you want to move?
+-+
+-+-+
+-+-+
+-+-+
+-+-+
+-+
How many steps do you want to move?
3
+-+
+-+-+
+-+-+
>>>
How many steps do you want to move?
1
+-+
+-+
>>>
Ln: 36 Col: 4
Transcribed Image Text:2 Python 3.8.2 Shell - File Edit Shell Debug Options Window Help D64)] on win32 Type "help", "copyright", "credits" or "license ()" " for more information. >>> How many steps do you want to move? +-+ +-+-+ +-+-+ +-+-+ +-+-+ +-+ How many steps do you want to move? 3 +-+ +-+-+ +-+-+ >>> How many steps do you want to move? 1 +-+ +-+ >>> Ln: 36 Col: 4
Please write a program that creates steps. You are expected to take in a single positive integer
which will be used as the number of steps in your stair case. The program only accepts integers
greater than 0 and less than 500. If 0 is entered a message stating "Your staircase has no
steps." and if the user enters a value greater than or equal to 500, a message stating "I can't
build a staircase that tall." For all other values not within the valid range or not integers an
"Invalid staircase size provided." will be displayed to the user. The program will always run only
once for each user input.
One thing to note, the messages should be the return string from your createSteps()
function and printed from the calling function.
Additional Requirements:
1. The very first step in the stair case will be left aligned and for each subsequent level
the step will move above and to the right of the prior step.
2. There are no spaces after the right of any of the steps.
3. The bottom most row ends without a new line.
1
This functions asks the user for the number of steps
03 A 6 X 1 ^
they want to climb, gets the value provided by the user
Aand returns it to the calling function'''
4
def getUserInput():
# your code belongs here
8
"" This function takes the number of steps as an unput parameter,
9.
creates a string that contains the entire steps based on the user input
10
and returns the steps string to the calling function
11
12
def createSteps(stepCount):
13
# your code belongs here
14
15
16
E'''Within this condition statement you are to write the code that
17
calls the above functions when testing your code the code below this
18
should be the only code not in a function and must be within the if
19
Astatement. I will explain this if statement later in the course.
20
if _name_-
"-_main_":
==
21
# your code belongs here
22
Transcribed Image Text:Please write a program that creates steps. You are expected to take in a single positive integer which will be used as the number of steps in your stair case. The program only accepts integers greater than 0 and less than 500. If 0 is entered a message stating "Your staircase has no steps." and if the user enters a value greater than or equal to 500, a message stating "I can't build a staircase that tall." For all other values not within the valid range or not integers an "Invalid staircase size provided." will be displayed to the user. The program will always run only once for each user input. One thing to note, the messages should be the return string from your createSteps() function and printed from the calling function. Additional Requirements: 1. The very first step in the stair case will be left aligned and for each subsequent level the step will move above and to the right of the prior step. 2. There are no spaces after the right of any of the steps. 3. The bottom most row ends without a new line. 1 This functions asks the user for the number of steps 03 A 6 X 1 ^ they want to climb, gets the value provided by the user Aand returns it to the calling function''' 4 def getUserInput(): # your code belongs here 8 "" This function takes the number of steps as an unput parameter, 9. creates a string that contains the entire steps based on the user input 10 and returns the steps string to the calling function 11 12 def createSteps(stepCount): 13 # your code belongs here 14 15 16 E'''Within this condition statement you are to write the code that 17 calls the above functions when testing your code the code below this 18 should be the only code not in a function and must be within the if 19 Astatement. I will explain this if statement later in the course. 20 if _name_- "-_main_": == 21 # your code belongs here 22
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education