how to use if else statement for string variable in python code example
Example 1: how to check a string in if statement python
if var == 'stringone' or var == 'stringtwo':
dosomething()
Example 2: how to check a string in if statement python
if var in ['string one', 'string two']:
do_something()