Logo

Python Questions Set 174:

Quiz Mode

What is the type of inf

1
2
3

Solution:

Waht is the return value of floor(3.6)?


1
2
3
4

Solution:

 Which of the following commands will create a list? 

1
2

Solution:

 

What will be the output of the following Python code?

print('Hello!2@#World'.istitle())

1
2

Solution:

What will be the output of the following Python code?

str1 = 'hello'

str2 = ','

str3 = 'world'

str1[-1]

1
2
3
4

Solution:

 What is used to define a block of code (body of loop, function etc.) in Python? 

1
2
3
4

Solution:

words = ['cat', 'window', 'defenestrate']

for w in words:

   print(w, len(w))

   break

1
2
3
4

Solution:

 

Is the following Python code valid?

>>> a,b,c=1,2,3
>>> a,b,c

1
2
3
4

Solution:

What will be the output of the following code?

class Sport: def __init__(self): print("I am in the class") cricket = Sport() footBall = Sport() cricket.score = 100 footBall.score = 3 print(footBall.score)

1
2
3
4

Solution: