Python Forum
What would be a substitute for "::"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What would be a substitute for "::"
#1
The use of :: is prohibited for certain assignments, what would be a substitute that would allow you to do things like print every other character in a string?
Reply
#2
If slicing is allowed for the object,  you can use it directly, e.g.:

'a string'[slice(None, None, 2)]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hotel problem from substitute. Owen89Northam 3 3,040 Jun-28-2018, 10:58 PM
Last Post: Zombie_Programming

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020