Jan-05-2019, 09:20 AM
(This post was last modified: Jan-05-2019, 09:21 AM by Axel_Erfurt.)
word = "potlucks" for i in range(0, len(word) + 1, 2): print(word[i:i + 2])
Output:po
tl
uc
ks
Splitting strings in python?
|
Jan-05-2019, 09:20 AM
(This post was last modified: Jan-05-2019, 09:21 AM by Axel_Erfurt.)
word = "potlucks" for i in range(0, len(word) + 1, 2): print(word[i:i + 2])
|
|
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 | 1,139 |
May-19-2024, 08:36 AM Last Post: Pedroski55 |
|
Trying to understand strings and lists of strings | Konstantin23 | 2 | 1,756 |
Aug-06-2023, 11:42 AM Last Post: deanhystad |
|
Splitting strings in list of strings | jesse68 | 3 | 2,569 |
Mar-02-2022, 05:15 PM Last Post: DeaD_EyE |
|
Finding multiple strings between the two same strings | Slither | 1 | 3,248 |
Jun-05-2019, 09:02 PM Last Post: Yoriz |
|
Python: if 'X' in 'Y' but with two similar strings as 'X' | DreamingInsanity | 6 | 5,068 |
Feb-01-2019, 01:28 PM Last Post: buran |
|
lists, strings, and byte strings | Skaperen | 2 | 4,986 |
Mar-02-2018, 02:12 AM Last Post: Skaperen |