You are on page 1of 3

Q.1: What is the output of print str[0] if str = 'Hello World!'?

ANS:

Q.2:What is the result of this code?

i=1

while True:

if i%0O7 == 0:

break

print(i)

i += 1

Ans:

Q:3 Result of the code?

i=1

while True:

if i%2 == 0:

break

print(i)

i += 2

ANS:

Q:4 Result of this code?

i=5

while True:

if i%0O9 == 0:

break

print(i)

i += 1
ANS:

Q:5 O/P of the following code?

i=0

while i < 5:

print(i)

i += 1

if i == 3:

break

else:

print(0)

ANS:

Q:6 Result of >>>"a"+"bc"?

ANS:

Q.7:What is the result of following code?

a=2

for i in range(4):

a=a*i

print(a)

ANS:

Q.8: a=12

C=int(a)+str(a) result?

ANS:

Q.9: What is the data type of 'inf' ?

ANS:
Q.10: Which of the following is an invalid statement?

a) abc = 1,000,000

b) a b c = 1000 2000 3000

c) a,b,c = 1000, 2000, 3000

d) a_b_c = 1,000,000

ANS:

Q.9:

i=1

while True:

print(i+2)

Result?

Q.10:

s=2

for i in range (1,10,2):

print(i+s)

Result:

You might also like