[Python] Python's `range` function with 3 parameters

Discussão em 'Python' iniciado por Stack, Agosto 31, 2025.

  1. Stack

    Stack Membro Participativo

    I understand that the following line will give the given result:

    for in range(5):
    print(i)


    0 1 2 3 4

    But I don't understand how if adding 3 separate parameters the result is confusing. How is this returning these particular results? (4 6 and 8) ????

    for i in range(4, 10, 2):
    print(i)


    4 6 8

    Continue reading...

Compartilhe esta Página