Python: Step Indexing

Post Reply
User avatar
Jason
Site Admin
Posts: 973
Joined: Sun Dec 21, 2025 8:56 pm
Contact:

Code: Select all

numbers_in_a_string = str("123456789")

print(numbers_in_a_string[  : : 3])

# This prints out 3, 6, 9
 

POSTREACT(ions) SUMMARY

Post Reply