Skip to content
- What is the output of
print("Python".rsplit("t", -1))?
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", 2))?
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.5 in Python?
a) [x * 0.5 for x in range(21)]
b) [x * 0.5 for x in range(20)]
c) [x * 0.5 for x in range(0, 21)]
d) [x * 0.5 for x in range(0, 20)]
Correct Answer: a) [x * 0.5 for x in range(21)]
- What is the output of
print("Python".rsplit("t", 2))?
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)]
- What is the output of
print("Python".split("t", 3))?
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.1 in Python?
a) [x * 0.1 for x in range(101)]
b) [x * 0.1 for x in range(100)]
c) [x * 0.1 for x in range(0, 101)]
d) [x * 0.1 for x in range(0, 100)]
Correct Answer: a) [x * 0.1 for x in range(101)]
- What is the output of
print("Python".rsplit("t", 3))?
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.05 in Python?
a) [x * 0.05 for x in range(201)]
b) [x * 0.05 for x in range(200)]
c) [x * 0.05 for x in range(0, 201)]
d) [x * 0.05 for x in range(0, 200)]
Correct Answer: a) [x * 0.05 for x in range(201)]
- What is the output of
print("Python".split("t", 4))?
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.01 in Python?
a) [x * 0.01 for x in range(1001)]
b) [x * 0.01 for x in range(1000)]
c) [x * 0.01 for x in range(0, 1001)]
d) [x * 0.01 for x in range(0, 1000)]
Correct Answer: a) [x * 0.01 for x in range(1001)]
- What is the output of
print("Python".rsplit("t", 4))?
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.02 in Python?
a) [x * 0.02 for x in range(501)]
b) [x * 0.02 for x in range(500)]
c) [x * 0.02 for x in range(0, 501)]
d) [x * 0.02 for x in range(0, 500)]
Correct Answer: a) [x * 0.02 for x in range(501)]
- What is the output of
print("Python".split("t", 5))?
a) [‘Py’, ‘hon’]
b) [‘Pyt’, ‘hon’]
c) [‘P’, ‘ython’]
d) Error
Correct Answer: a) [‘Py’, ‘hon’]
Pages:
1 2 3 4 5 6 7 8 9 10