Post

Python Developer
Python Developer@PythonDvz·
What will be the output? Write your answer in the comments and share it with your friends✅✉️
Python Developer tweet media
English
18
8
92
9.8K
Muhammad Yusuf
Muhammad Yusuf@quarksci·
Correct answer: B [2, 7, 12] Quick explanation: range(2, 17, 5) starts at 2, adds 5 each time, and stops before reaching (or passing) 17. So: 2 → 2+5=7 → 7+5=12 → 12+5=17 (excluded) → [2, 7, 12] Here is a fact: Many people intuitively think the stop value is inclusive — but in Python range() the stop is always exclusive. That's why range(5) gives [0,1,2,3,4] and not 5. Same logic applies here.
English
0
0
5
365
Paylaş