Skip to content

Commit 2daba64

Browse files
authored
added punctuation remove program 👩‍💻
1 parent 015f060 commit 2daba64

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# define punctuation
2+
punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
3+
4+
my_str = "Hello!!!, he said ---and went."
5+
6+
# To take input from the user
7+
# my_str = input("Enter a string: ")
8+
9+
# remove punctuation from the string
10+
no_punct = ""
11+
for char in my_str:
12+
if char not in punctuations:
13+
no_punct = no_punct + char
14+
15+
# display the unpunctuated string
16+
print(no_punct)

0 commit comments

Comments
 (0)