2 Basic Python Program :
1. Read and display user Inputs in Python Program
2. Sum And Average of float numbers using Python Program
1. Read and display user Inputs
id = int(input("Enter Id: "))
name = input("Enter Name: ")
sal = input("Enter Salary: ")
print(" Your Id ={} \n Name = {} \n Salary={}".format(id,name,sal))
---------------------------------------------------------------------
2. Sum And Average of float numbers
a,b,c= [float(i) for i in input ("Enter 3 number: ").split()]
sum= a+b+c
avg = sum/3
mul = a*b*c
print(" sum=%i \n Average= %.2f, mul= %i" % (sum,avg,mul))
--------------------------------------------
No comments:
Post a Comment