0
Python (check example, please): is it correct to use for not in var? What can be an alternative to achieve same result?
Example: var = "abc" for c not in var: print (a)
4 Antworten
+ 2
It's an error... When you use not in, in a for loop... There's nothing to print...
+ 1
First tell me, what the output should be?
+ 1
Okay, solved. I wanted to get a text input from the user and to eliminate any character that was not a number from the text. So I have just introduced inside for loop an "if c not in" and I managed to get the result. Thank you!!
0
And is there any form to do it?