import math print(int(math.pow(8,7))) print(8 ** 7) s=1 for i in range(1,8): s=s * 8 print(s) k=1s=1 while k < 8: s=s*8 k=k+1 print(s) Output 2097152209715220971522097152
Tag Archives: Python
Python automorphic number
auto.py Automorphic number when it is squared,the last number in square contains original number. For example 5 is automorphic number Square of 5 = 25 ( last number is 5 i.e. original number) iSquare=0; iPower=0; iRem = 0; iNumber = input(“Please enter a number: “) iPower = len(iNumber) iSquare = int(iNumber) ** 2; iNumber =Continue reading “Python automorphic number”
Python duck number
Duck number contains at least one occurrence of 0 as digit For example 101 101 contains 0 as digit. duck.py iDigit=0 iFlag=0 i=0 //Input number iNumber=int(input(“Please enter a number: “)) //Store number in vaiable i i=iNumber //Extract digit and scan it for 0 while i>0: iDigit=i%10 if iDigit==0: Continue reading “Python duck number”
You must be logged in to post a comment.