Logo

Python Questions Set 56:

Quiz Mode

What is the repetition operator in Python?

1
2
3
4

Solution:

  What is x if x = math.isfinite(float(‘0.0’))?
 

1
2
3
4

Solution:

Which of these is not a core data type in Python?

1
2
3
4

Solution:

Which types of operands are permitted with logical operators in Python?

1
2
3
4

Solution:

x=input() y=input() print(x//y)

If the input lines are "4" and "2", find the output of the above code.

1
2
3
4

Solution:

Consider a listEx is [20, 5, 25, 1, 3], what is the result after listEx.pop(1) 

1
2
3
4

Solution:

What will be the output of the following Python code?

>>> a={3,4,5}
>>> b={5,6,7}
>>> a|b

1
2
3
4

Solution:

If we run __name__, which imports another module, then it will print ___________?

1
2
3
4

Solution:

Which of the following statements about strings in Python is true?

1
2
3
4

Solution:

 

fp=open("txt.txt")

c=0

for i in fp:

    if not i.startswith("H"):

        c+=1

print(c)



If the file txt.txt contains the following text then what is the output of the above code?



hello

World!! Hi

Hello

check



Solution: