Can you please explain the syntax in this python if-else statement


#1
def finish_game(score):
  tickets = 10 * score
  if score >= 10:
    tickets += 50
  elif score >= 7:
    tickets += 20
  return tickets

The above is the example for the following link:
Click HERE!

I dont understand what the += part here means.


#2

+= is an assignment operator.

Another name for it is compound operator or augmentation operator but those are lesser used terms.

a = a + 1  =>  a += 1

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.