Answer to Question #283833 in Python for Alsaba

Question #283833

python program at least 50 lines with tuple,dictionary,mathematical operation,list and format


1
Expert's answer
2021-12-31T01:42:17-0500
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)

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