Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function print _ steps ( walks , name ) that takes a dictionary walks mapping people's names to ( distance , step _

Write a function print_steps(walks, name) that takes a dictionary walks mapping people's names to (distance , step_length) tuples and a name from that dictionary, and prints the number of steps that person walked.
Distances and step lengths are both in metres, so you can calculate the number of steps using:
steps=distancestep_length
The number of steps should be printed to the nearest whole number.
For example:
Test Result
walks ={
"Angus McGurkinshaw": (1000,0.5),
"Bobert Buckingdale": (1000,0.4),
"Suzan Smith": (1500,0.5),
"Jackie Jean": (2000,0.5)
}
print_steps(walks, "Angus McGurkinshaw")
Angus McGurkinshaw: 2000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions