Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I change a string.
#4
well this breaks the example both in terms of example input and expected output.
It breaks the example input as I understood it - a word in words list is concatenated to previous word, i.e. my understandig was the input would be When parents goWhat do they listen toWhyHow
It breaks the expected output as I understood it - a word in list is preceded by dot and space, i.e. making a complete sentence.
When parents go. What do they listen to. Why. How

All that said - define explicit rules how the input string will look like and what the expected output should be and then a more complex parser should be created
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
How can I change a string. - by Mike Ru - Jun-03-2020, 10:03 AM
RE: How can I change a string. - by buran - Jun-03-2020, 10:13 AM
RE: How can I change a string. - by Mike Ru - Jun-03-2020, 10:39 AM
RE: How can I change a string. - by buran - Jun-03-2020, 10:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  change string in MS word Mr_Blue 8 3,322 Sep-19-2021, 02:13 PM
Last Post: snippsat
  Question about change hex string to integer sting in the list (python 2.7) lzfneu 1 2,529 May-24-2021, 08:48 AM
Last Post: bowlofred
  Change string into Dict Robin_at_Cantelli 2 2,929 Mar-05-2020, 10:37 AM
Last Post: vishalhule
  "replace() method" fails to change string pw928gts 4 3,411 Nov-30-2018, 05:48 PM
Last Post: nilamo
  Change values in string multiline DavidFernandez 4 3,092 Aug-26-2018, 08:09 PM
Last Post: buran

Forum Jump:

User Panel Messages

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