python lab practice
python lab practice
LAB
D KISHORE BABU
Assistant Professor
SESHADRI RAO GUDLAVALLERU ENGINEERING COLLEGE
Department Of Mechanical Engineering
Example 1: Add Two Numbers with fixed values
Program
num1 = 1.5
num2 = 6.3
# Add two numbers
sum = num1 + num2
# Display the sum
print ('The sum of 1.5 and 6.3 is’, sum)
output:
output:
output:
a = 5
b = 6
c = 7
# Uncomment below to take inputs from the user
# a = float (input ('Enter first side: '))
# b = float (input ('Enter second side: '))
# c = float (input ('Enter third side: '))
output:
output:
# Calculate miles
output:
celsius = (Fahrenheit-32)*5/(9)
output:
Total_marks = sub1+sub2+sub3+sub4+sub5+sub6
Percentage = (Total_marks)/(6)
output:
Example 10: To find the distance between two points
Program
output: