1) Write a python program the prompts the user for number to find the
following
i)a number is even or odd
x=int(input(“Enter x:”))
if x%2==0:
print(“x is even :”)
else:
print(“ x is odd:”)
ii)a number is positive or negative
x=int(input(“Enter x:”))
if n > 0:
print(“Positive”)
else:
print(“Negative”)
2) Write a python program to check whether the given number is
palindrome or not.
x=int(input(“Enter a number: “))
n=x
rev=0
while n>0:
rem=n%10
rev=rev*10+rem
n=n//10
print(“Reverse number is:”,rev)
if x==rev:
print(x, “is a palindrome” )
else:
print(x, “is not a palindrome “)
3) Write a python program to find largest of 3 number
a = 10
b = 14
c = 12
if (a >= b) and (a >= c):
largest = a
elif (b >= a) and (b >= c):
largest = b
else:
largest = c
print(“the largest number is “,largest)
4) Write a python program the prompts the user for Celsius temperature .convert the
temperature to Fahrenheit .print out converted temperature.
celsius = float(input(“Enter temperature in celsius:”))
fahrenheit = (celsius * 1.8) + 32
print(“the temperature in Fahrenheit” , fahrenheit )