0% found this document useful (0 votes)
3 views2 pages

Python

Uploaded by

jerophinebeni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Python

Uploaded by

jerophinebeni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

4.

Write a python program to find largest of three numbers

Python program to find the largest number among the three input numbers

# change the values of num1, num2 and num3


# for a different result
num1 = 10
num2 = 14
num3 = 12

# uncomment following lines to take three numbers from user


#num1 = float(input("Enter first number: "))
#num2 = float(input("Enter second number: "))
#num3 = float(input("Enter third number: "))

if (num1 >= num2) and (num1 >= num3):


largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3

print("The largest number is", largest)

Output

The largest number is 14.0

5. Write a python program to convert temperature to and from Celsius to Fahrenheit

# Temperature in celsius degree


celsius = 47

# Converting the temperature to


# fehrenheit using the formula
fahrenheit = (celsius * 1.8) + 32

# printing the result


print('%.2f Celsius is equivalent to: %.2f Fahrenheit'
% (celsius, fahrenheit))

output
47.00 Celsius is equivalent to: 116.60 Fahrenheit

You might also like