0% found this document useful (0 votes)
9 views4 pages

Python Programs for Basic Operators

The document contains a series of Python programs that demonstrate the use of operators for various calculations. Each program addresses a specific problem, such as calculating area, profit, interest, and shares among friends or pirates. The programs involve user input and perform arithmetic operations to produce results.

Uploaded by

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

Python Programs for Basic Operators

The document contains a series of Python programs that demonstrate the use of operators for various calculations. Each program addresses a specific problem, such as calculating area, profit, interest, and shares among friends or pirates. The programs involve user input and perform arithmetic operations to produce results.

Uploaded by

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

PROGRAMS ON OPERATORS

Q1.

l=int(input("Enter the length of ground-"))


b=int(input("Enter the breadth of ground-"))
print("The required length is-",2*(l+b),"m")
print("The required area of carpet is-",l*b,"sqm")

Q2.

a=int(input("enter the no. of copies sold-"))


b=int(input("enter the cost per copy-"))
c=int(input("enter the cost spend per copy-"))
print("profit is-",(a*b)-(a*c)-100)

Q3.

a=int(input("Enter a 4-digit number-"))


b=a%1000
while a>=10:
a=a//10;
c=a
print(b+c)

Q4.

a=int(input("Enter the number of friends-"))


b=int(input("Enter the number of teams-"))
print("The number of friends in each team is",a//b," and left out is",a%b)
Q5.

a=float(input("enter the principal amount-"))


b=float(input("enter the rate of interest-"))
c=float(input("enter the time-"))
si=(a*b*c)/100
amt=a+si
dis=si*0.02
final=amt-dis
print("interest is-",si)
print("amount is-",amt)
print("discount is-",dis)
print("final settlement is-",final)

Q6.

x1=int(input("enter the first value-"))


y1=int(input("enter the second value-"))
x2=int(input("enter the third value-"))
y2=int(input("enter the fourth value-"))
print("Arun's house is located at (",(x1+x2)/2,",",(y1+y2)/2,")")

Q7.

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=b+d
cent=e%100
dollar=a+c+((e-cent)//100)
print(dollar)
print(cent)

Q8.

a=int(input("enter the number of gold coins-"))


b=int(input("enter ben's share percentage-"))
c=int(input("enter blackbeard's share percentage-"))
d=(a*b)//100
e=((a-d)*c)//100
f=(a-d-e)//3
print("long ben's share is-",d)
print("blackbeard's share is-",e)
print("3 pirates' share is-",f)

Q9.

a= int(input("Enter the integer number: "))


rev= 0
while (a>0):
b=a%10
rev=(rev*10)+b
a=a//10
print("reversed number is-",rev)
Q10.

a=int(input("enter a number between 1 to 9-"))


if(a%3==0):
b=(a//3)-1
c=3
else:
b=a//3
c=a%3
print("row and column is-(",b,",",c,")")

You might also like