Question: His program is shown below: # Knightro # Lab 1 : Challenge 1 # COP 2 5 0 0 # Aug 2 8 , 2

His program is shown below:
# Knightro
# Lab 1: Challenge 1
# COP 2500
# Aug 28,2023
# Ask for input
steps=input ("How many steps?
")
distance=input ("Total feet traveled?
")
# Calculate Steps
pace = distance*12? steps
# Output paces as inches
print("Your average step is",pace, "inches")
He is getting this error.
pace = distance*12? steps
TypeError: unsupported operand type(s) for /: 'str' and 'str'
This is because distance and steps are not numeric data but strings. How can we correct his program so it can run?
Question 1
2 pts
The number of steps should be a whole number. How can we correct this line of code to accept input as a whole number?
steps=input ("How many steps?
")
 His program is shown below: # Knightro # Lab 1: Challenge

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!