Page 1 of 1

Python: Step Indexing

Posted: Fri Apr 24, 2026 2:04 pm
by Jason

Code: Select all

numbers_in_a_string = str("123456789")

print(numbers_in_a_string[  : : 3])

# This prints out 3, 6, 9