0
How can i avoid punctuation??
words = input().split(" ") for word in words: word = word[1::]+word[0]+'ay' print(word,end = " ")
13 Antworten
+ 4
the filter(function, iterable) filters all chars that are not punct.
It returns a filter expression that is reconverted to a string.
It is a bit runaway but worth to become familiar with it.
+ 2
Instead of split(), use RegEx
https://www.sololearn.com/learn/9704/?ref=app
+ 2
is there any?
+ 2
if input is aha, oho, soso?
input().split(",")
+ 2
For delete ".,!? ..." and "1234..." you can use check by .isalpha
Or you can use:
word=word.replace('.','')
+ 1
text = input('')
lis=text.split()
for sam in lis:
length=len(sam)
x,y=sam[1:length],sam[0]
print(x+y+'ay',end=' ')
Try this this may help
+ 1
from string import punctuation
a ='hello world; today is a nice day .!'
a = ''.join([letter for letter in a if letter not in punctuation ])
print(a)
0
I dont know about it
0
It will include punctuation if input
0
If input is vikas. Karyani
It will include . Also i want to avoid it
0
Can u explain this?
0
What does re work for?