0
Possible methods for use in if or statement
This was an exercise for codecoach 'spy life". I wanted to use an if statement within a list comprehension but I'm having trouble with the phrasing. It works if I lazily combine the two strings but cant seem to get it to work using an 'or' statement to compare both strings against the string elements within (i). https://code.sololearn.com/ctP5iZ84x6aO/?ref=app
5 Answers
+ 3
ren What is especifically your question. Cause in your code, you should use a word reverse (I don't know it's name) and a string "cleaner"... So what's your question?
+ 2
You need use and not or. [ In that way]
Edit:
If you use or, then not in punctuation comes true and 'not in digit' not calculated.....
Edit:
ren
print(''.join([i for i in encoded[::-1] if i not in d and i not in p]))
0
Guess I got some reading to do :)
0
My question was just on different ways if and or can be used to achieve certain effects. I was trying to make a loose clause where the item could be in string(x) or string(y). Didnt consider use of and
0
First impression for me is to use or since if it's in either than pass through it didnt require it to be in both