Does Python have a string ‘contains’ substring method?
Use the in operator: if “blah” not in somestring: continue
Use the in operator: if “blah” not in somestring: continue
You can use a global variable within other functions by declaring it as global within each function that assigns a value to it: globvar = 0 def set_globvar_to_one(): global globvar # Needed to modify global copy of globvar globvar = 1 def print_globvar(): print(globvar) # No need for global declaration to read value of globvar … Read more