For example, let's say I have a bunch of assignment statements like this:
if operator == '==':
if a == b:
c += 5
elif operator == '>':
if a > b:
c += 5
elif operator == '<':
if a < b:
c += 5
The if nested if statements and assignments I gave are just examples but in the program I'm writing, they are really long. Just a small change is present where the operators differ, so I don't want to have to repeat the same long piece of code over and over again just for all these conditions. There are too many conditions and the code will get repeated many times..so is there a "faster" way to do this? Can I maybe define a string as an operator? Or any better ways?