Professional Documents
Culture Documents
n=10
a=0
b=1
print(a)
print(b)
i=0
while True:
i=i+1
if(i<=10):
c=a+b
print(c)
a=b
b=c
else:
break
****************************************OR************************
*******************
n=int(input('enter the value of n'))
a=0
b=1
print(a)
print(b)
while True:
if(n!=0):
c=a+b
print(c)
a,b=b,c
n=n-1
#TO PRINT THE FIBONACCI SERIES based on User input
a=0
b=1
print(a)
print(b)
i=0
while True:
i=i+1
if(i<=n):
c=a+b
print(c)
a=b
b=c
else:
print('out of loop')
break
#Sample program to check if the given input is mobile number
count=0
k=mno
while True:
if(type(mno%10)==int):
count=count+1
mno=mno//10
if(mno//10==0):
break
if(count==9):
else:
QUIZ
1) x = 12
y = 18
x=y
y=x
print(x,y)
Ans:
2) what is an exponent operator?
Ans:
3) What is a operator(quotient)?
Ans:
4) math=3**3? result?
Ans:
5) 26%7 result?
Ans:
Ans:
a) x = 13 // 2
b) x = int(13 / 2)
c) x = 13 / 2
d) x = 13 % 2
Ans:
8) What is the average value of the code that is executed below ?
>>>x = 80
>>>y = 90
a) 85
b) 85.0
c) 95
d) 95.0
ANS:
c) print('hello-' + 'how-are-you')
Ans:
10) What is the result of following code?
a=8
if (a=='8'):
else:
print('good bye')
Ans: