In [1]:
num = int(input("Enter number: "))
sum = 0
temp = num
while temp > 0:
   digit = temp % 10
   sum += digit ** 3
   temp //= 10
if num == sum:
   print(num,"is an Armstrong number")
else:
   print(num,"is not an Armstrong number")
Enter number: 153
153 is an Armstrong number
In [37]:
num = int(input("Enter number: "))
sum = 0
temp = num
while temp > 0:
   digit = temp % 10
   sum += digit ** 3
   temp //= 10
if num == sum:
   print(num,"is an Armstrong number")
else:
   print(num,"is not an Armstrong number")
Enter number: 353
353 is not an Armstrong number
In [34]:
n = int(input("Enter number: "))
a = 0
b = 1
c = 1

if n==0 or n==1:
    print("Yes. {} is a fibonnaci number".format(n))
else:
    while a<n:
        a=c+b
        c=b
        b=a

    if a==n:
        
        print("Yes. {} is a fibonnaci number".format(n))
    else:
            
        print("No. {} is NOT a fibonacci number".format(n))
Enter number: 34
Yes. 34 is a fibonnaci number
In [36]:
n = int(input("Enter number: "))
a = 0
b = 1
c = 1

if n==0 or n==1:
    print("Yes. {} is a fibonnaci number".format(n))
else:
    while a<n:
        a=c+b
        c=b
        b=a

    if a==n:
        
        print("Yes. {} is a fibonnaci number".format(n))
    else:
            
        print("No. {} is NOT a fibonacci number".format(n))
Enter number: 99
No. 99 is NOT a fibonacci number
In [ ]: