The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #144
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(len(list(range(0, len(a), 3))))
The third parameter of the range() function being a step, range(0, len(a), 3)) will return [0, 3, 6, 9] . Its length is 4. (thepythonguru.com/python-builtin-functions/range)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) May 24, 2020
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(len(list(range(0, len(a), 3))))
3
5
4
2#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: