- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.18 in Python?
a) [x * 0.18 for x in range(56)]
b) [x * 0.18 for x in range(55)]
c) [x * 0.18 for x in range(0, 56)]
d) [x * 0.18 for x in range(0, 55)]
Correct Answer: a) [x * 0.18 for x in range(56)]
- What is the output of
print("Python".split("t", 13))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.19 in Python?
a) [x * 0.19 for x in range(53)]
b) [x * 0.19 for x in range(52)]
c) [x * 0.19 for x in range(0, 53)]
d) [x * 0.19 for x in range(0, 52)]
Correct Answer: a) [x * 0.19 for x in range(53)]
- What is the output of
print("Python".rsplit("t", 13))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.2 in Python?
a) [x * 0.2 for x in range(51)]
b) [x * 0.2 for x in range(50)]
c) [x * 0.2 for x in range(0, 51)]
d) [x * 0.2 for x in range(0, 50)]
Correct Answer: a) [x * 0.2 for x in range(51)]
- What is the output of
print("Python".split("t", 14))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.21 in Python?
a) [x * 0.21 for x in range(48)]
b) [x * 0.21 for x in range(47)]
c) [x * 0.21 for x in range(0, 48)]
d) [x * 0.21 for x in range(0, 47)]
Correct Answer: a) [x * 0.21 for x in range(48)]
- What is the output of
print("Python".rsplit("t", 14))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.22 in Python?
a) [x * 0.22 for x in range(46)]
b) [x * 0.22 for x in range(45)]
c) [x * 0.22 for x in range(0, 46)]
d) [x * 0.22 for x in range(0, 45)]
Correct Answer: a) [x * 0.22 for x in range(46)]
- What is the output of
print("Python".split("t", 15))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.23 in Python?
a) [x * 0.23 for x in range(44)]
b) [x * 0.23 for x in range(43)]
c) [x * 0.23 for x in range(0, 44)]
d) [x * 0.23 for x in range(0, 43)]
Correct Answer: a) [x * 0.23 for x in range(44)]
- What is the output of
print("Python".rsplit("t", 15))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.24 in Python?
a) [x * 0.24 for x in range(42)]
b) [x * 0.24 for x in range(41)]
c) [x * 0.24 for x in range(0, 42)]
d) [x * 0.24 for x in range(0, 41)]
Correct Answer: a) [x * 0.24 for x in range(42)]
- What is the output of
print("Python".split("t", 16))
?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
- Which of the following is used to create a list of numbers from 0 to 10 in steps of 0.25 in Python?
a) [x * 0.25 for x in range(41)]
b) [x * 0.25 for x in range(40)]
c) [x * 0.25 for x in range(0, 41)]
d) [x * 0.25 for x in range(0, 40)]
Correct Answer: a) [x * 0.25 for x in range(41)]
Conclusion
Mastering Python requires consistent practice and a deep understanding of its concepts. By solving these 150 Best Python MCQs, you can enhance your programming skills and prepare for technical interviews. Whether you’re a beginner or an advanced learner, these questions will help you identify areas for improvement and build confidence in your Python knowledge.