How to print the ASCII punctuation characters from a string in Python

1 Answer

0 votes
import string  
 
s = "Python, Programming."

for ch in s:
    if ch in string.punctuation:
        print(ch)
 
 
     
'''
run:
 
,
.

'''

 



answered May 17, 2019 by avibootz
...