Skip to content

Commit d58e3e3

Browse files
Merge pull request #1152 from Mayank-Singla9/patch-2
Python Program to Remove Punctuations from a String
2 parents c41c983 + 5789745 commit d58e3e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Python Program to Remove Punctuations from a String

+5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
33
my_str = "Hello!!!, he said ---and went."
44

55
no_punct = ""
6+
patch-2
7+
for char in my_str:
8+
if char not in punctuations:
9+
no_punct = no_punct + char
610

711
for char in my_str:
812

913
if char not in punctuations:
1014

1115
no_punct = no_punct + char
1216

17+
master
1318
print(no_punct)

0 commit comments

Comments
 (0)