In python, I'm supposed to write a program that asks the user for a string, and then it removes all occurrences of p, q, r, s, t (lower and upper-case), then print out everything else.
For input Today it is Tuesday
it should print oday i i ueday
.
I've written the code but it doesn't remove the last letter if needed. Here is what I've written:
S = str(input("Please enter some text: "))
L = list(S)
for i in L :
if i in 'tsrqpPQRST' :
L.remove(i)
string = ""
for char in L :
string = string + char
print(string)