3/11/25, 3:24 PM Python Exp 2
In [3]: user = int(input("Enter the Number to Find if it is Even or Odd"))
if (user % 2 != 0) :
print (" The Number Entered is Odd:" , user)
else:
print (" The Number Entered is Even:" , user)
The Number Entered is Even: 4
In [7]: a = float(input("Enter 1st Number"))
b = float(input("Enter 2nd Number"))
c = float(input("Enter 3rd Number"))
if (a>b and a>c):
print ("The Largest of three number is:", a)
elif(b>a and b>c):
print ("The Largest of three number is:",b)
else:
print ("The Largest of three number is:",c)
The Largest of three number is: 92.0
In [33]: n= int(input("Enter the Number"))
factorial = 1
if n==0:
print(" The factorial of 0 is 1")
else:
for i in range(1,n+1):
factorial= factorial*i
print ("factorial of ",n,"is", factorial)
factorial of 5 is 1
factorial of 5 is 2
factorial of 5 is 6
factorial of 5 is 24
factorial of 5 is 120
In [ ]:
[Link] Exp 2 (2).html 1/1