Atul (Python)
Atul (Python)
Program 31
Code :-
#define punctuation
from string import punctuation
punctuation = "'!()-[]{};:\,<>./?@#$%^&*_~'"
my_str = "Hello!!!, he said ---and went."
#To take input from the user
#my_str = input("Enter a string :")
#remove punctuation from the string
no_punct = ""
for char in my_str:
if char not in punctuation:
no_punct = no_punct + char
#display the unpunctuated string
print(no_punct)
Output :-
COLLEGE OF TECHNOLOGY AND ENGINEERING
NAME:- ATUL KUMAWAT SUBJECT:- DATA ANALYSIS WITH PYTHON
CLASS:- B.TECH III YEAR DATE:-
Program 32
Program 33
Program 34
Program 35
Program 36
Program 37
Program 38
Program 39
Program 40
Program 41