Answers for "what means return in python"

1

what means return in python

# Lets say you have a nice game
// Copy this code and try it out :)
def finish_game(score):
  tickets = 10 * score
  if score >= 10:
    tickets += 50
  elif score >= 7:
    tickets += 20
  print(tickets)
  return tickets

endScore = 4;
finish_game(endScore)


# You finish with your game with endScore 10, you will get 150 Tickets
# Depending on your score on the game you get tickets
# There are much more utilities for return in python
Posted by: Guest on June-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language