I've got a for loop statement which returns True if a character inputed by a user exists in a specific list.
However I want to be able to include multiple lists instead of just one.
This is the code I have so far
char=string.lowercase
upper=string.uppercase
for char in input_str:
if char in symbols:
print "symbol"
if char in upper:
print 'upper'
I want to be able to modify this so it checks for more than one condition in the same if statement.
So, if statement gets changed to something like this (but in proper Python syntax):
if char in symbols and in upper:
print "Symbols and Upper"
Aucun commentaire:
Enregistrer un commentaire