Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write this in paython the output should be the same Write a function called coin _ matches ( ) that takes a list of coin

write this in paython the output should be the same Write a function called coin_matches() that takes a list of coin values and a list of coin
names of the same length. This function returns a list of the indices where the coins' values
match the name of the coin.
Assumptions:
The length of the list of values is not longer than the list of coin names.
The coins you can expect are: penny (1), nickel (5), dime(10), quarter(50), dollar(100)
Signature:
def coin_matches(values, names):
#your code here
# ...
return
Examples:
coin_matches(['dime','dime','nickel'],[10,10,5])-> output[0,1,2]
coin_matches(['dime', 'dime', 'dime'],[10,10,5,1])->output[0,1]
['penny', 'dime', 'nickel', 'dollar', 'dime', 'nickel', '-> out put [2,3,7]
['dime', 'dime', 'penny'],[1,1,1]-> output [2]

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

Step: 3

blur-text-image

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What are the key business issues facing Jan?

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago