Engineering Questions with Answers - Multiple Choice Questions

Python MCQs

1 - Question

1. What will be the output of the following Python code snippet?

print('for'.isidentifier())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: Even keywords are considered as valid identifiers.




2 - Question

2. What will be the output of the following Python code snippet?

print('abc'.islower())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: There are no uppercase letters.




3 - Question

3. What will be the output of the following Python code snippet?

print('a@ 1,'.islower())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: There are no uppercase letters.




4 - Question

4. What will be the output of the following Python code snippet?

print('11'.isnumeric())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: All the character are numeric.




5 - Question

5. What will be the output of the following Python code snippet?

print('1.1'.isnumeric())

a) True
b) False
c) None
d) Error

View Answer

Answer: b
Explanation: The character . is not a numeric character.




6 - Question

6. What will be the output of the following Python code snippet?

print('1@ a'.isprintable())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: All those characters are printable.




7 - Question

7. What will be the output of the following Python code snippet?

print(''''''.isspace())

a) True
b) False
c) None
d) Error

View Answer

Answer: b
Explanation: None.




8 - Question

8. What will be the output of the following Python code snippet?

print('\t'.isspace())

a) True
b) False
c) None
d) Error

View Answer

Answer: a
Explanation: Tab Spaces are considered as spaces.




9 - Question

9. What will be the output of the following Python code snippet?

print('HelloWorld'.istitle())

a) True
b) False
c) None
d) Error

View Answer

Answer: b
Explanation: The letter W is uppercased.




10 - Question

10. What will be the output of the following Python code snippet?

print('Hello World'.istitle())

a) True
b) False
c) None
d) Error

View Answer
Answer: a
Explanation: It is in title form.

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners