Posts

Showing posts with the label python mini project

WAP to obtain temperature in Celsius and convert it into Fahrenheit using formula. °C×9/5+32=°F

#celsius to fahrenheit  Cels= float(input("Enter temp in Celsius:")) Print(" Temperature in Celsius is:",Cels) Fahr=Cels×9/5+32 Print("Temperature in Fahrenheit is:",Fahr)

program to calculate BMI (body mass index) of a person.

#to calculate BMI = Kg/m square Weight _in_kg = float (input("Enter weight in kg:")) Height_in_meter = float(input("Enter height in meter :")) Bmi = Weight_in_kg / ( Height_in_meter* Height_in_meter) Print("BMI is:", Bmi) Output Enter weight in kg  : 66 Enter height in meter : 1.6 BMI is : 25.781249999999996

program to obtain three numbers and print their sum.

Image
#to input 3 numbers and print their sum. Num1=int(input("enter number1;")) Num2=int(input("enter number2;")) Num3=int(input("enter number3;")) Sum= Num1+Num2+Num3 Print("Three numbers are:",num1,num2,num3) Print("sum is :",sum)

To find average number in python programming.

# Get three test score round1 = int(input("Enter score for round 1: ")) round2 = int(input("\nEnter score for round 2: ")) round3 = int(input("\nEnter score for round 3: "))     # Calculate the average average = (round1 + round2 + round3) / 3 # Print out the test score print("\nThe average score is: ", average) Output: 4 37 64 Enter score for round 1: Enter score for round 2: Enter score for round 3: The average score is: 35.0

To find area of triangle in python programming

# Find the area of triangle a = 5 b = 6 c = 7 # calculate the semi-perimeter s = (a + b + c) / 2 # calculate the area area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 print('The area of the triangle is %0.2f' %area) Output : The area of the triangle is 14.70

To find the sum of two numbers in python programming

# This program adds two numbers value1 = 14.0 value2 = 56.60 # Add two numbers result = float(value1) + float(value2) # Display the sum print('The sum of {0} and {1} is {2}'.format(value1, value2, result)) Output: The sum of 14.0 and 56.6 is 70.6