WAP to Find the Square Root of given number.
no = float(input('Enter a number: '))
no_sqrt = no ** 0.5
print('square root “,no_sqrt)
#WAP to Convert Celsius To Fahrenheit
celsius = float(input("enter celsius"))
# calculate fahrenheit
fahrenheit = (celsius * 1.8) + 32
print('%0.1f degree Fahrenheit' %fahrenheit)
# WAP to convert degree to radian
pi=22/7
degree = float(input("Input degrees: "))
radian = degree*(pi/180)
print(radian)
#convert radian to degree
pi=22/7
radian = float(input("Input radians: "))
degree = radian*(180/pi)
print(degree)
#WAP to find factorial of given number
n=int(input("Enter number:"))
fact=1
while(n>0):
fact=fact*n
n=n-1
print("Factorial of the number is: ")
print(fact)
#WAP to enter a string and print its reverse
s=input("enter a string")
str = ""
for i in s:
str = i + str
print(str)
#WAP to enter a string and check it is palindrome or not
s=input("enter a string")
str = ""
for i in s:
str = i + str
if(s==str):
print("Palindrome")
else:
print("Not Palindrome")
# Python program to find largest number in a list
# list of numbers
list1 = [10, 20, 4, 45, 99]
# sorting the list
list1.sort()
# printing the second last element
print("Second largest element is:", list1[-2])
# Python program to check leap year or not
year=int(input(“enter a year”))
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print("Leap Year")
else:
print("Not a Leap Year")
else:
print("Leap Year")
else:
print("Not a Leap Year")