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}
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))
Comments
Leave a comment