I’m a newbie in python, and try to grab the ‘spirit’ of it.
Simple question :
I want to test if either 'a' or 'b' are in a string 'xxxxxbxxxxx'
I obvisouly could do
full_string = 'xxxxxbxxxxx'
if 'a' in full_string or 'b' in full_string :
print 'found'
but I feel there is a more simple way to do it “python style”, without repeating full_string , what could be it ?
I think this is as close as you can get:
Or you could use regular expressions: