Python Functions
Classroom Module
A-1
Examine Output Of Code
num=[]
while True:
n=input("enter n or 'stop':")
if n=='stop':
break
else:
n=int(n)
[Link](n)
n=input("enter n or 'stop':")
print(max(num))
Examine Output Of Code
#to print multiplication tables
a=int(input('enter the number of tables:'))
b=int(input('upto which multiple:'))
i=1
while i<=a:
for j in range(1,b+1):
print(i,'*',j,'=',i*j)
i+=1
Examine Output Of Code
#to print GCD of two numbers
a=int(input('enter a:'))
b=int(input('enter b:'))
i=1
if a>b:
max=a
else:
max=b
while i<=max:
if a%i==0 and b%i==0:
gcd=i
i+=1
else:
i+=1
print('GCD is',gcd)