python program at least 50 lines with tuple,dictionary,mathematical operation,list and format
def tup(*argv):
list1 = []
for i in argv:
list1.append(i)
tuple1 = tuple(list1)
return tuple1
def fac_cal(num):
list1 = []
for i in range(1,num+1):
if num % i == 0:
list1.append(i)
return list1
def dic(*argv):
dic = {}
for i in argv:
dic[i] = fac_cal(i)
return dic
def calc(*argv):
list1 = []
for i in argv:
list1.append(i)
return 'The sum of the numbers is {}'.format(sum(list1))
print(dic(4,6,5,9))
print(calc(4,6,5,9))
print(tup(4,6,5,9))
{4: [1, 2, 4], 6: [1, 2, 3, 6], 5: [1, 5], 9: [1, 3, 9]}
The sum of the numbers is 24
(4, 6, 5, 9)
Comments
Leave a comment