In line 4 why do we have to add \"=\" after \"-\" ?
num = 5 if num > 2: print(num) num -= 1 print(num)
You are essentially asking the difference between
num - 1
and
num -= 1
The former is an expression that evaluates to num - 1. The latter is an assignment that assigns num - 1 to num.
num
So, the former does not modify num, the latter does.