Python 1.2
Python 1.2
WORKSHEET 1.2
1. Aim:
2. Source Code:
1)
num=int(input("Enter a number:"))
temp=num
rev=0
while(num>0):
dig=num%10
rev=rev*10+dig
num=num//10
if(temp==rev):
DEPARTMENT OF
2)
num = int(input("Enter a 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")
3)
a = int(input('Enter the first value:'))
b =int(input('Enter the second value:'))
c = int(input('Enter the third value:'))
Greatest= 0
if a > b and a > c: greatest = a
DEPARTMENT OF
3. Screenshot of Outputs:
1)
2)
3)