it is necessary to check whether the address of the site 'http://ru.stackoverflow.com' exists in the href variable
href = 'http://ru.stackoverflow.com/questions/ask' it is necessary to check whether the address of the site 'http://ru.stackoverflow.com' exists in the href variable
href = 'http://ru.stackoverflow.com/questions/ask' Form a complete answer.
Check for one line in another
s = 'tt' st = 'testtest' if s in st: print "входит" check for "not included"
s = 'tb' st = 'testtest' if s not in st: print "не входит" Check if the line starts with the given one.
s = 'te' st = 'testtest' if st.startswith(s): print "начинается с" Source: https://ru.stackoverflow.com/questions/532682/
All Articles
if 'http://ru.stackoverflow.com' in your_var: ...- KoVadimru.stackoverflow.com- Kill Noiseif "str" not in "other str":- KoVadim