By Rishi Jain: 1) 1 Digit To 3 Digit
By Rishi Jain: 1) 1 Digit To 3 Digit
1) 1 Digit to 3 digit
a=int(input('Enter the 1-digit no.'))
b=((a)*100)+((a+1)*10)+(a+2)
print(b)
A=math.pi*(r**2)
P=2*math.pi*r
print(A)
print(P)
Rectangle
print('area and perimeter of rectangle')
A=l*b
P=2*(l+b)
print(A)
print(P)
Square
print('area and perimeter of square:')
A=a**2
P=4*a
print(A)
print(P)
e=(b**2+h**2)**0.5
P=b+h+e
D=1/2*b*h
print(D)
prin
t(P)
3) Area of Triangle
a=int(input('Enter the 1st side'))
s=(a+b+c)/2
a=(s*(s-a)*(s-b)*(s-c))**0.5
print(a)
4) Arithmatic Operator
a=int(input('Enter the 1st value'))
print('sum',a+b)
print('subract',a-b)
print('division',a/b)
print('multiplication',a*b)
print('modulus',a%b)
print('exponent',a**b)
print('floor division',a//b)
5) Assignment Operator
c=int(input('Enter the value'))
c+=5
print(c)
c-=5
print(c)
c*=1
print(c)
c//=2
print(c)
c**=2
print(c)
c%=10
print(c)
c/=4
print(c)
6) Celsius to fehrenheit
c=float(input('Enter the temperature'))
f=(c+32)*9/5
print(f,'f')
k=273+c
print(k,'K')
inch=2.54*a
feet=12*(2.54*a)
print(inch,"inch")
print(feet,"feet")
print('exponent',a**3)
9) Days to Year
d=int(input('enter the number of days'))
Y=d//365
W=(d%365)//7
D=(d%365)%7
print(Y,'year',W,'week',D,'days')
meter=M=F//3.280
print(M)
b=a//100
c=a%100
s=b**2+c**2
print(s)
M=physics+maths+chemistry
P=(M/300)*100
print(M)
print(P)
x,y=y+5,x+3
print(x,y)
a,b=b,a
print(a,b)
14) Reverse of Two Digit Number
a=int(input('Enter the two digit number'))
b=a//10
c=a-(b*10)
d=(c*10)+b
print(d)
M=S//60
s=S%60
print(M,'Minutes',s,'Seconds')
16) Simple Interest
p=int(input('Enter the principle'))
ST=p*r*t/100
print(ST)
print(a)
a,b=a+b,b+c
print(a,"\n",b)
19) Type ID
a=int(input('Enter the value'))
print( type(a))
print( id(a))
print( type(a))
print( id(a))
print( type(b))
print( id(b))
print(math.sqrt(a))
print(math.ceil(b))
print(math.exp(a))
print(math.fabs(b))
print(math.floor(b))
print(math.log(N,B))
print(math.log10(s))
print(math.pow(b,e))
print(math.sin(A))
print(math.cos(A))
print(math.tan(A))
print(math.degrees(j))
print(math.radians(x))
21) Anagram
a=input("enter string1=")
b=input("enter string2=")
check=True
for i in a:
if i not in b:
check=False
if(check==True):
for i in b:
if i not in a:
check=False
if(check==True):
print("anagram")
else:
print("not anagram")
print('it is a triangle')
else:
while(ex=='y' or ex=='Y'):
print('a=4,7,10.......40')
print('b=-4,7,-10.......-40')
if(ch=='a'):
for i in range(1,41,3):
print(i,end=' ')
elif(ch=='b'):
for i in range(1,41,3):
if(i%2==0):
print(-1*i,end=" ")
else:
print(i,end=" ")
else: