Header Ads

Responsive Ads Here

Question/Solution - 8

Question



# {1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20}  --- > 2

# input from user----> number

# key ----> range(1,10)


Solution



num = int(input("Enter the number: "))
d = {}

for i in range(1,11):
    d[i] = num * i

print(d)

Powered by Blogger.