Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why doesn't strip work?
#1
import string
dogs = "All.Good,Dogs.. Eat.! Shoes?"
dogs = dogs.strip(string.punctuation)
print(dogs)
My result is All.Good,Dogs.. Eat.! Shoes
with no punctuation removed. Correction: The ? disappeared but I thought all punctuation would go.
Reply


Messages In This Thread
Why doesn't strip work? - by cybervigilante - Dec-26-2018, 10:10 PM
RE: Why doesn't strip work? - by stullis - Dec-26-2018, 10:12 PM
RE: Why doesn't strip work? - by snippsat - Dec-26-2018, 10:28 PM
RE: Why doesn't strip work? - by cybervigilante - Dec-27-2018, 12:51 AM
RE: Why doesn't strip work? - by snippsat - Dec-27-2018, 02:04 AM
RE: Why doesn't strip work? - by metulburr - Dec-27-2018, 02:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why doesn't calling a parent constructor work with arbitrary keyword arguments? PurposefulCoder 4 936 Jun-24-2023, 02:14 PM
Last Post: deanhystad
  Why doesn't this code work? What is wrong with path? Melcu54 7 1,785 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  color code doesn't work harryvl 1 889 Dec-29-2022, 08:59 PM
Last Post: deanhystad
  extract only text strip byte array Pir8Radio 7 2,943 Nov-29-2022, 10:24 PM
Last Post: Pir8Radio
Smile please help me remove error for string.strip() jamie_01 3 1,199 Oct-14-2022, 07:48 AM
Last Post: Pedroski55
  client.get_all_tickers() Doesn't work gerald 2 1,714 Jun-16-2022, 07:59 AM
Last Post: gerald
  pip doesn't work after Python upgrade Pavel_47 10 4,200 May-30-2022, 03:31 PM
Last Post: bowlofred
  Can't strip extra characters from Data Canflyguy 7 1,864 Jan-10-2022, 02:16 PM
Last Post: Canflyguy
  For Loop Works Fine But Append For Pandas Doesn't Work knight2000 2 2,013 Dec-18-2021, 02:38 AM
Last Post: knight2000
  Class Method to Calculate Age Doesn't Work gdbengo 1 1,703 Oct-30-2021, 11:20 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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