Answer to Question #312918 in Python for vanss

Question #312918

Write a program that use dictionaries to build tables. Complete a method that

receives 2 parameters. The first parameter states how many entries are in the dictionary and the second

number represents the multiplier for each entry.


Ex:

Input: 10, 5


Output: {1: 5, 2: 10, 3: 15, 4: 20, 5: 25, 6: 30, 7: 35, 8: 40, 9: 45}



1
Expert's answer
2022-03-17T08:55:33-0400
def multiplier_for_each (n, m):
    dict = {} 
    for i in range(10):
        if i != 0 :
            dict[i] = i*5
    return dict


print(multiplier_for_each(10,5))   

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS