Python Forum
Splitting strings in python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splitting strings in python?
#4
word = "potlucks"
for i in range(0, len(word) + 1, 2):
    print(word[i:i + 2])
Output:
po tl uc ks
Reply


Messages In This Thread
Splitting strings in python? - by NLittle17 - Jan-05-2019, 08:35 AM
RE: Splitting strings in python? - by Axel_Erfurt - Jan-05-2019, 09:01 AM
RE: Splitting strings in python? - by NLittle17 - Jan-05-2019, 09:12 AM
RE: Splitting strings in python? - by Axel_Erfurt - Jan-05-2019, 09:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can you explain the strings in Python ebn852_pan 3 276 May-19-2024, 08:36 AM
Last Post: Pedroski55
  Trying to understand strings and lists of strings Konstantin23 2 896 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Splitting strings in list of strings jesse68 3 1,887 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  Finding multiple strings between the two same strings Slither 1 2,599 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  Python: if 'X' in 'Y' but with two similar strings as 'X' DreamingInsanity 6 3,961 Feb-01-2019, 01:28 PM
Last Post: buran
  lists, strings, and byte strings Skaperen 2 4,317 Mar-02-2018, 02:12 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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