PROGRAM
PROGRAM
#OUTPUT
====== RESTART: /Users/chaitanya/Desktop/py/factorial using while
loop.py ======
enter real number:10
fact= 3628800
a=int(input("enter a no-"))
b=int(input("enter a no-"))
c=int(input("enter a no-"))
#OUTPUT
================ RESTART: /Users/chaitanya/Desktop/py/maximum.py
===============
enter a no-2
enter a no-4
enter a no-6
6 is maximum no.
#OUTPUT
=============== RESTART: /Users/chaitanya/Desktop/py/pattern 2.py
==============
Enter the no. of rows4
****
***
**
*
4 # PROGRAM TO PRINT SQUARE PATTERN
for i in range(0,n):
for j in range(1,n+1):
print('*',end="")
print()
#OUTPUT
=============== RESTART: /Users/chaitanya/Desktop/py/pattern 3.py
==============
Enter the number of rows:-5
*****
*****
*****
*****
*****
for i in range(0,n):
for j in range(n-i):
print('',end='')
for j in range(i,2*i+1):
print('*',end='')
for j in range(1,i+1):
print('*',end='')
print()
#OUTPUT
=============== RESTART: /Users/chaitanya/Desktop/py/pattern 4.py
==============
Enter the no.of rows5
*
***
*****
*******
*********
6 # PROGRAM TO FIND THE SUM EVEN AND ODD ITEGERS OF 1ST NATURAL
NUMBER.
#OUTPUT
if n==1:
print("Finding volume of cube",volume())
elif n==2:
print("Finding curved surface area",Curved_area())
elif n==3:
print("Finding Total surface area",Total_area())
else:
print("Invalid choice")
#OUTPUT
#OUTPUT
#OUTPUT
======= RESTART: /Users/chaitanya/Desktop/py/volume and area of
sphere.py ======
Enter the radius4
AREA 201.06192982974676
VOLUME 268.082573106329
#OUTPUT
def Add(a,b):
Sum=a+b
return Sum
def Subtract(a,b):
difference=a-b
return difference
def Multiply(a,b):
product=a*b
return product
def Divide(a,b):
quotient=a/b
return quotient
def squ(a):
sqre=a**2
sqre=b**2
return sqre
def sqrot(a):
sqroot= math.sqrt(a)
sqrout= math.sqrt(b)
return sqroot
n1=int(input("Enter the value"))
n2=int(input("Enter the value"))
print("For add press 1","For subtract press 2","For multiply press
3","For divide press 4","For square press 5","For square root press
6")
a=int(input("Enter what you want to do:-"))
if a==1:
print("Sum of the numbers",Add(n1,n2))
elif a==2:
print("difference of the numbers",Subtract(n1,n2))
elif a==3:
print("product of the numbers",Multiply(n1,n2))
elif a==4:
print("Dividing of the numbers",Divide(n1,n2))
elif a==5:
print("Finding the Square n1",n1**2)
print("Finding the Square n2",n2**2)
elif a==6:
print("The square root of the number is:-",sqrot(n1))
print("The square root of the number is:-",sqrot(n2))
else:
print("invalid choice")
# OUTPUT