0% found this document useful (0 votes)
10 views2 pages

Python Code 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 TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Python Code 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 TXT, PDF, TXT or read online on Scribd

*

num=int(input("enter number for which you want table :"))


for i in range(1,11):
print (num,'x',i,'=',num*i)
*
a=int(input("enter a cp"))
b=int(input("enter a sp"))
p=b-a
pp=p/a*100
print(p)
print(pp)
*
x = int(input("Enter a two-digit:")):
y = x % 10:
n = int(n/10):
print("The sum is",(y+x))
print("The product is",(y*x))
*
num=int(input("enter number for which you want table :"))
for i in range(1,11):
print (num,'x',i,'=',num*i)

output

enter number for which you want table :7


7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
*a=int(input("enter a sp"))
b=int(input("enter a cp"))
p= a-b
pp= p/b*100
print(p)
print(pp)
pp=profit percentage
p=profit
*
a=int(input("enter seconds"))
h=a\\3600
r=a%3600
m=r\\60
s=r%60
print(h)
print(m)
print(s)
*
s=0
x=4
while(x<=20):
s=s+2
x=x+4
print("The sum of series"+s)
*
i=1
while (i<=10)
print("2x",i,"=",2*i)
i=i+1
*
s=0
x=4
while(x<=20):
s=s+2
x=x+4
print("The sum of series"+s)
*
# generation of multiplication table
num=int(raw input("enter no for which you want table:"))
for i in range (1,11):
print num, 'x',i,'num*i

You might also like