What is the output of range(2, 100, 2)?

Prepare for the Leaving Certificate Computer Science Test with a mix of flashcards and multiple choice questions, each designed to enhance learning. Discover tips and resources for success. Ace your exam with confidence!

The output of the function range(2, 100, 2) generates a sequence of numbers starting from 2, up to but not including 100, with a step of 2. This means it will include every second number beginning from 2 up to 98.

So, the first number in this sequence is 2, followed by 4, 6, 8, and so on, continuing until it reaches 98. Thus, all the numbers produced will be even numbers, forming a complete sequence of even numbers from 2 to 98, which aligns perfectly with the choice indicating a sequence of even numbers within that range.

The other options do not accurately depict what the range function outputs.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy