You are on page 1of 3

1.

Input your name and print a message,”Name, welcome to the world of


python programming.”

x=input(("enter your name please-->"))


print(x,"welcome to the world of python
x=Jiya programming")
Jiya,”welcome to the world of python programming” input("press enter key to continue")

2. Input 5 integers and print sum and average in integer.

enter 1st no.-->5 a=int(input("enter 1st no.-->"))


enter 2nd no.-->6 b=int(input("enter 2nd no.-->"))
enter 3rd no.-->4 c=int(input("enter 3rd no.-->"))
enter 4th no.-->8 d=int(input("enter 4th no.-->"))
enter 5th no.-->9 e=int(input("enter 5th no.-->"))
sum of all numbers= 32 print("sum of all numbers=",a+b+c+d+e)
average of all numbers= 24 print("average of all
press enter key to continue.… numbers=",int(a+b+c+d+e/5))
input("press enter key to continue....")

3. Input 5 float numbers and print sum and average.

enter 1st no.-->3.2 a=float(input("enter 1st no.-->"))


enter 2nd no.-->6.5 b=float(input("enter 2nd no.-->"))
enter 3rd no.-->4.2 c=float(input("enter 3rd no.-->"))
enter 4th no.-->9.8 d=float(input("enter 4th no.-->"))
enter 5th no.-->5.3 e=float(input("enter 5th no.-->"))
sum of all numbers= 29.0 print("sum of all numbers=",a+b+c+d+e)
average of all numbers= 24.759999 print("average of all numbers=",float(a+b+c+d+e/5))
input("press enter key to continue....")

4. Input temperature in Celsius and print in Fahrenheit and vice versa.


Enter degree temperature in celsius-->35
35.0 celsius 95.0 x=float(input(“enter degree temperature in
celsius-->”))
print(x,”celsius”,(x*1.8)+32,”fahrenheit”)
y=float(input(“enter degree temperature in
fahrenheit-->”))
print(y,”fahrenheit=”,(y-32)/1.8,”celsius”)
input("press enter key to continue....")
5. Input length and breadth, print area and perimeter. Also check if its
square or rectangle. l=int(input(“enter length-->”))
b=int(input(“enter breadth-->”))
print(“area of figure=”,l*b)
Enter length:6
print(“perimeter of the figure=”,2*(l+b))
Enter breadth:4
if(l==b):
Area of figure=24
print(“it’s a square”)
Perimeter=20 else:
It’s a rectangle. print(“it’s a rectangle”)

6.Input base and height and then print are of triangle.


b=int(input(“enter the base of triangle-->”))
enter the base of triangle-->6 h=int(input(“enter height of triangle -->”))
enter height of triangle-->9 print(“area of triangle=”,0.5*b*h)
area of triangle=27.9

7.Input 5 names for a list and print the


list with a message. a=input("enter name1-->")
enter name1-->jiya b=input("enter name2-->")
enter name2-->manisha c=input("enter name3-->")
enter name3-->saurabhi d=input("enter name4-->")
enter name4-->prachi e=input("enter name5-->")
enter name5-->sneha x=[a,b,c,d,e]
['jiya', 'manisha', 'saurabhi', 'prachi', print(x,",welcome! to the world of Python
'sneha'] ,welcome! to the world of Python programming.")
programming. input ("press enter' to continue.....")
press enter' to continue.....

8. Input 10 numbers in list and print list in ascending order .


enter num 1-->89 a=int(input("enter num 1-->"))
enter num 2-->65 b=int(input("enter num 2-->"))
enter num 3-->78 c=int(input("enter num 3-->"))
enter num 4-->23 d=int(input("enter num 4-->"))
enter num 5-->12 e=int(input("enter num 5-->"))
enter num 6-->64 f=int(input("enter num 6-->"))
enter num 7-->89 g=int(input("enter num 7-->"))
enter num 8-->75 h=int(input("enter num 8-->"))
enter num 9-->26 i=int(input("enter num 9-->"))
enter num 10-->14 j=int(input("enter num 10-->"))
[12, 14, 23, 26, 64, 65, 75, 78, 89, 89] x=[a,b,c,d,e,f,g,h,i,j]
press enter key to continue--> x.sort()
print(x)
input("press enter key to continue-->")
9.Input a number as float and print its integral value.
x=float(input("enter any number-->"))
enter any number-->6.5 print(int(x))
6 input("press enter key to continue")
press enter key to continue

10.

You might also like