Sunday, March 3, 2019

Power of N (n^5) using user define function - Python3

def power(n):
    list1=[]
    result = n
    for i in range(5):
        list1.append(result)
        result *= n       
    return list1

ip=int(input('Enter the value of n: '))
a=power(ip)
print (a)

ScreenShots:


No comments:

Post a Comment