Professional Documents
Culture Documents
Python CTRL STMT
Python CTRL STMT
)
print("To find the largest among 3 numbers")
print("*****************************")
num1=float(input("Enter the 1st number: "))
num2=float(input("Enter the 2nd number: "))
num3=float(input("Enter the 3rd number: "))
print('Numbers Entered Are')
print(" Number1: ",num1)
print(" Number2: ",num2)
print(" Number13: ",num3)
if((num1>num2) and (num1>num3)):
largest = num1
elif((num2>num1)and (num2>num3)):
largest = num2
else:
largest = num3
print("The largest num is:",largest)
-----------------------------------------------------------------
OUTPUT
-----------------------------------------------------------------
OUTPUT:
OUTPUT
OUTPUT
Enter the Option2
The number is: 2 and the day is: Monday
>>>
Enter the Option5
The number is: 5 and the day is: Thursday
-------------------------------------------------------------------------------
#5. To check whether a given is a Palindrome using while statement
print("Find the given number is Palindrome")
n=int(input("Enter the number"))
sum=0
a=n
while(n>0):
m=n%10
sum=sum*10+m
n=n//10
if(sum==a):
print("The given number is Palindrome")
else:
print("The given number is not Palindrome")
OUTPUT: