0% found this document useful (0 votes)
13 views15 pages

Python Programs for Basic Calculations

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

Python Programs for Basic Calculations

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IN GEOMETRY

x=float(input())
y=3.142*x*x
print("The area of the circle with radius",x,"is:",y)

NANCY BOUGHT APPLE

x=int(input())
y=int(input())
q, r = divmod(x,y)
print("Quotient:{}".format(q))
print("Remainder:{}".format(r))

THANVIS MATHS (NOT WORKING)

x=float(input())
y=(4/3)*3.142*x*x*x
print(y)

ELECTRICITY BOARD

x=int(input())
y=int(input())
z=x**y
print(z)

TIMOTHY BOON

lname=input()
fname=input()
print("Hello",fname ,lname)
VIGNESH DEGREE
x=input()
y=input()
print("Name: {}\nDegree: {}".format(x,y) )

VETRIVEL TIME

x=int(input())
y=int(input())
a=int(input())
b=int(input())
print((x*86400)+(y*3600)+(a*60)+b)

BINITA TRAIN

x=int(input())
q, r = divmod(x,60)
print(q,"Hours and",r,"Minutes")

JANAKI DISTANCE

x1=int(input())
y1=int(input())
x2=int(input())
y2=int(input())
z=(((x2-x1)**2)+((y2-y1)**2))**(1/2)
print(z)

LAASYA LEAP YEAR

x=int(input())
z=x%4
if(z==0):
print("LEAP YEAR")
else :
print("NOT A LEAP YEAR")

KARTHIK HR

x=float(input())
y=float(input())
z=x*y
print("%.2f"%z)

CALEB DASA

x=float(input())
v=(2*x*9.8)**(1/2)
print("%0.2f"%v,"m/s")

ARUL AND KANI FARM

x=float(input())
a=3.14*x*x
b=2*3.14*x
print("%0.2f"%a)
print("%0.2f"%b)

ISSAC AGRICULTURE

x=float(input())
y=x/43560
print(x,"[Link] is equal to","%0.2f"%y,"acres")
JAANU AND PREETHI (NOT WORKING)

x=float(input())
y=float(input())
z=(1/2)*(x)*(y)
print("%0.3f"%z)

BOOMI BREAD

x=int(input())
a=x*185
b=0.6*a
y="%0.2f"%b
c=a-b
l="%0.2f"%c
print("Regular Price={}".format(a))
print("Amount Discounted={}".format(y))
print("Amount to be paid={}".format(l))

PROGRAM TO COMPUTE a+aa+aaa+aaaa

x=int(input())
y=x*11
z=x*111
a=x*1111
print(x+y+z+a)

BNITA FLYING

x=int(input())
y=float(input())
z=x/(y*y)
print("%0.2f"%z)
FLIPKART CLEARANCE SALE

x=int(input())
print(x**1,x**2,x**3)

SATHYA MATHEMATICAL EXPERT

x=float(input())
y=float(input())
z=x**y
print("%0.2f"%z)

KRISHNA MADHURA HOUSE

x, y = input().split()
a=int(x)
b=int(y)
z=(a*b)/2
print("%0.0f"%z)

RAJA STATISTICIAN

x, y = input().split()
a=float(x)
b=float(y)
mode=(3*a)-(2*b)
z="%0.2f"%mode
print("Mode={}".format(z))

SUDHAN CENTROID OF TRIANGLE

x1,y1 = input().split(",")
x2,y2 = input().split(",")
x3,y3 = input().split(",")
xx="%0.2f"%((int(x1)+int(x2)+int(x3))/3)
yy="%0.2f"%((int(y1)+int(y2)+int(y3))/3)
print("({},{})".format(xx,yy))

JANAKI OCTAL CONVERSION

def decToOctal(n):
octalNum = [0] * 100
i=0
while (n != 0):
octalNum[i] = n % 8
n = int(n / 8)
i += 1
for j in range(i - 1, -1, -1):
print(octalNum[j], end="")
n=int(input())
decToOctal(n)

VIGNESH FORMAT

x,y,z= input().split()
print("I have {} dollars so I can buy {} football for {}.00
dollars.".format(y,x,z))

SALIMA DRESS

x,y= input().split()
a=float(x)
b=float(y)
z="%0.2f"%((a*12*2.54)+(b*2.54))
print("Your height in centimeters is : {}".format(z))
JAANU AND PREETHI PYRAMID

x, y = input().split()
a=float(x)
b=float(y)
z=(1/2)*(a)*(b)
print("%0.3f"%z)

NATHAN STUDENT AND NERD

x=int(input())
y=int(input())
a=float(input())
b=int(input())
c=a*b
print("%0.2f"%c)

ARULMOZHIVARMAN'S DREAM

x=int(input())
y=int(input())
z=int(input())
a=(x*y)/100
b=(x*z)/100
c=x+a+b
print("%.0f"%c)

COMPUTE AREA OF A TRIANGLE

s1=float(input())
s2=float(input())
s3=float(input())
s=(s1+s2+s3)/2
x=(s*(s-s1)*(s-s2)*(s-s3))**(1/2)
print("The area of triangle is",x

AARON TOOK HIS GF

billwt=int(input())
x=(0.18)*billwt
y=(0.05)*billwt
z=x+y+billwt
print("The Tax is","%.2f"%x)
print("The Tip is","%.2f"%y)
print("Total Bill With Tax and Tip is","%.2f"%z)

SAJID TRAIN TICKET

x,y,z=input().split()
a=int(x)
b=int(y)
c=int(z)
q=a+b+c
print(q)

ARIF ROOM CLEANING ROBOT

x=float(input())
y=float(input())
z=x*y
print("%.2f"%z)

CALEB AND SALIMA NILAGAIS

x=int(input())
y=int(input())
if(x>y):
print(x-y)
else:
print(x+y)

THREE BROTHERS PHOTOGRAPH

x=int(input())
y=int(input())
if(x>y):
print(x-y)
else:
print(x+y)

ROYAL SQUATRACLUB EYE DONATION

age=int(input())
weight=int(input())
if(age>18 and weight>40):
print("Eligible for Donation")
else:
print("Not Eligible for Donation")

YASIR TECHIE LANDMINE

x= int(input())
if(x>0):
print("POSITIVE")
else:
print("NEGATIVE")

[Link] PRINCIPAL

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
avg=(a+b+c+d+e)/5
print("%0.2f"%avg,"Percent")
if(avg>=90):
print("Grade A")
elif(avg>=80):
print("Grade B")
elif(avg>=70):
print("Grade C")
elif(avg>=60):
print("Grade D")
elif(avg>=40):
print("Grade E")
else:
print("Grade F")

CALEB AND IRFAN APPLES

x=int(input())
y=int(input())
z=int(input())
if(y>x and z>y):
print("Fit into Budget")
else:
print("Doesn't fit into Budget")

PAYTM CASHBACK

x=int(input())
if((x%2)==0):
print("Even Currency")
else:
print("Odd Currency")

ONE PROGRAMMING LANGUAGE IDENTIFIERS

x=input()
if(x=="break"):
print(x,"is a keyword")
elif(x=="case"):
print(x,"is a keyword")
elif(x=="continue"):
print(x,"is a keyword")
elif(x=="default"):
print(x,"is a keyword")
elif(x=="defer"):
print(x,"is a keyword")
elif(x=="else"):
print(x,"is a keyword")
elif(x=="for"):
print(x,"is a keyword")
elif(x=="func"):
print(x,"is a keyword")
elif(x=="goto"):
print(x,"is a keyword")
elif(x=="if"):
print(x,"is a keyword")
elif(x=="map"):
print(x,"is a keyword")
elif(x=="return"):
print(x,"is a keyword")
elif(x=="range"):
print(x,"is a keyword")
elif(x=="struct"):
print(x,"is a keyword")
elif(x=="type"):
print(x,"is a keyword")
elif(x=="var"):
print(x,"is a keyword")
else:
print(x,"is a not keyword")

RAJEEV PROGRAMMING

a,b=input().split()
x=int(a)
y=int(b)
if(x>y):
print(">")
elif(y>x):
print("<")
else:
print("=")

NITHIYANANDA ZODIAC

day = int(input())
month = input()
if month == 'december':
astro_sign = 'Sagittarius' if (day < 22) else 'capricorn'
elif month == 'january':
astro_sign = 'Capricorn' if (day < 20) else 'aquarius'
elif month == 'february':
astro_sign = 'Aquarius' if (day < 19) else 'pisces'
elif month == 'march':
astro_sign = 'Pisces' if (day < 21) else 'aries'
elif month == 'april':
astro_sign = 'Aries' if (day < 20) else 'taurus'
elif month == 'may':
astro_sign = 'Taurus' if (day < 21) else 'gemini'
elif month == 'june':
astro_sign = 'Gemini' if (day < 21) else 'cancer'
elif month == 'july':
astro_sign = 'Cancer' if (day < 23) else 'leo'
elif month == 'august':
astro_sign = 'Leo' if (day < 23) else 'virgo'
elif month == 'september':
astro_sign = 'Virgo' if (day < 23) else 'libra'
elif month == 'october':
astro_sign = 'Libra' if (day < 23) else 'scorpio'
elif month == 'november':
astro_sign = 'scorpio' if (day < 22) else 'sagittarius'
print(astro_sign)

GIVEN POSITIVE INTEGER

x=int(input())
if(x==2):
print("Same")
elif((x%2)==0):
print("Even")
else:
print("Odd")

RHEA PANDEY TEACHER

x=int(input())
if(x==12 or x==1 or x==2):
print("Season:Winter")
elif(x==3 or x==4 or x==5):
print("Season:Spring")
elif(x==6 or x==7 or x==8):
print("Season:Summer")
elif(x==9 or x==10 or x==11):
print("Season:Autumn")
else:
print("Invalid month")
SARAVANAN AND MANIKANDAN TRAIN GAME

x=int(input())
y=int(input())
if(x>y):
print(x-y)
else:
print(x+y)

YOGESH MAGIC SHOW TICKET

x=int(input())
for i in range(1,x+1):
for j in range(1,i+1):
print(i,end=" ")
print()

ARAV POPULAR MATH TRAINER

x=int(input())
y=x%10
print(y)

YASIR MAKINNG KITE

s1=float(input())
s2=float(input())
s3=float(input())
s=(s1+s2+s3)/2
x=(s*(s-s1)*(s-s2)*(s-s3))**(1/2)
print("%.2f"%x)
NANCY DATA SCIENTIST

w,x,y,z=input().split()
a=int(w)
b=int(x)
c=int(y)
d=int(z)
print("EmployeeID :",c)
print("Area Code :",d)
print("House Number :",a)
print("Pincode :",b)

KURUKSHETRA BATTLE

x=int(input())
for i in range(x+1,0,-1):
for j in range(0,i-1):
print("*",end="")
print("")

You might also like