Top 10 Python Programs

Top 10 Python Programs

If you are worried about basic fundamentals of python then you are on write place .In this blog you will learn top 10 Python program in details. 

Here you will learn the following programs-

1) Enter name,age,and address one by one and display them
2) WAP to Find Square Root of any number
3) WAP to Swap Two Number
4) WAP to Swap Two Number without using third variable
5) WAP to display months and days for entered no. of days.
6) Enter 5 numbers, and find their sum, average and display them
7) WAP to convert celsius to Fahrenheit
8) WAP to Generate a Random Number
9) WAP to perform Arithmetic operation add,sub,mul,div
10) WAP to print 5 subject marks of student also print total and percentage.



1) Enter name,age,and address one by one and display them

name=input(“Enter Name”)
age=int(input(“Enter the age”))
address=input(“Enter Address”)
print(“Name=”,name)
print(“Age=”,age)
print(“Address=”,address)

2) WAP to Find Square Root of any number

num=float(input(“Enter Any Number”))
s=num**0.5
print(“Square Root of”,num,”is”,s)

3) WAP to Swap Two Number

a=int(input(“Enter The value of a”))#10
b=int(input(“Enter The value of b”))#20
print(“Value of a Before Swapping=”,a)#10
print(“Value of b Before Swapping=”,b)20
temp=a #temp=10
a=b #a=20
b=temp #b=10
print(“Value of a After Swapping=”,a)#20
print(“Value of b After Swapping=”,b)#10




4) WAP to Swap Two Number without using third variable

a=int(input(“Enter The value of a”))#10
b=int(input(“Enter The value of b”))#20
print(“Value of a Before Swapping=”,a)#10
print(“Value of b Before Swapping=”,b)#20
a,b=b,a
print(“Value of a After Swapping=”,a)#20
print(“Value of b After Swapping=”,b)#10

5) WAP to display months and days for entered no. of days.

days=int(input(“Enter number of days”))
months=days/30
day=days%30
print(“Months=”,int(months))
print(“Days=”,day)

6) Enter 5 numbers, and find their sum, average and display them

a=int(input(“Enter the first Number”))
b=int(input(“Enter the second Number”))
c=int(input(“Enter the third Number”))
d=int(input(“Enter the fourth Number”))
e=int(input(“Enter the fifth Number”))
sum=a+b+c+d+e
avg=sum/5
print(“Sum=”,sum)
print(“Average=”,avg)

7) WAP to convert celsius to Fahrenheit

c=float(input(“Enter celsius”))
far=(c*1.8)+32
print(far)

8) WAP to Generate a Random Number

import random
print(random.randint(10,25))

 




9) WAP to perform Arithmetic operation add,sub,mul,div

a1=int(input(“enter the value for addition”))
b1=int(input(“enter the value for addition”))
print(“Addition=”,a1+b1)
a2=int(input(“enter the value for sub”))
b2=int(input(“enter the value for sub”))
print(“Subtraction=”,a2-b2)
a3=int(input(“enter the value for multi”))
b3=int(input(“enter the value for multi”))
print(“Multiplication=”,a3*b3)
a4=int(input(“enter the value for Division”))
b4=int(input(“enter the value for Division”))
print(“Division=”,a4/b4)

10) WAP to print 5 subject marks of student also print total and percentage.

p=int(input(“Enter the marks of phy”))
c=int(input(“Enter the marks of chemistry”))
m=int(input(“Enter the marks of math”))
e=int(input(“Enter the marks of english”))
h=int(input(“Enter the marks of hindi”))
total=p+c+m+e+h
per=total*100/500
print(“Total=”,total)
print(“Percentage=”,per)



I hope You like the Post Top 10 Python Programs. For More Program and Classes visit our youtube channel. The Link is given below-

click here

Python input from command line

Python Algorithm and PSEUDOCODE 

 

Leave a Comment