How do I use a variable inside an if statement in python? For example, month_report
contains:
October
November
December
January
and cycle_report
contains:
October,Monthly
November,Monthly
November,Quarterly
January,Monthly
Below is how I would think variable can be used.
mcount = 0
qcount = 0
ncount = 0
for month in month_report:
for x in cycle_report:
if x == "{month},Monthly":
mcount += 1
elif x == "{month},Quarterly":
qcount += 1
else:
ncount += 1