We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
WAP to check any number is prime or not
nt (input("Enter eny number: '))
else:
print('Not prime’)
break
else:
yest
Af y=
print (‘Prine no
iter any number: 71
Prime no.
AWAP to find the factorial value of any number
fel
nt (input(‘enter any number: '))
while
fof%
issn
print(#)
enter any nunber:$
362880
‘WAP to print all the even number between 1 and 30
ist
while ic30:
tet
if 1N2==0:
print (i)
WAP to print all the odd number between 1 and 30
while i<30:
ited
if Anzio:
print(i)In [12
In [10
In [19
WAP to input any number ond print the table of that number
nt (input(‘enter any number: '))
for i in range(10):
print ((i+1)*x)
enter any number:2
WAP to print the sum of even and odd number individually between 1 to 50
ist
sun=0
total=0
for i in range(1,50,1):
if nz
sun=sum+i
print("sum of odd number is", sun)
print("total of even numbers is",total)
sum of odd number is 625
total of even numbers is 60
NAP to input any digit no. and print the sum of its digit
0
eint(input( ‘enter any digit no"))
while x!=0:
yey+(oe1e)
x//=10
print(y)
enter any digit no1234
18
AWAP to print the sum of nth nunber
sun=0
n=int(input(‘enter nth number'))
for i in range(1,n+1,1):sum=sum+i
print (sum)
enter nth nunberé
21
WAP to check any number is prime or not
xcint(input(Enter any number’) if x
orint(y) else: y+=1 if y==x print( Prime no.’)
or x==3: print(’x) else: y=2 while x>y: if x%y==0
aWAP to check any number is prime or not
xzint(input('Enter any nunber:'))
if or
print(*x")
else:
ye2
while xy
if x
print(*y’)
else: y#=1
print('Prime no.*)
File "", line 5
else:
syntaxError: invalid syntax