Invalid Syntax Error
So I'm making a small program that gets user input, and prints it back out, but ignores the letter c(lowercase and uppercase)
Note: Language is python
So I used the following code
for x in input('Enter your phrase: '):print(x,end="") if x.upper() != 'C'
But when I try to run it all I'm getting is
Syntax Error: invalid syntax
Why isn't it working?
ur doing the list comprehension syntax a bit wrong
print(''.join('' if x.upper() == 'C' else x for x in input('Enter your phrase: ')))
it goes after the expression