Nov-07-2022, 01:04 AM
(This post was last modified: Nov-07-2022, 06:25 AM by Yoriz.
Edit Reason: Added code tags
)
Hi, We're in a beginner Python class and creating text adventure games.
We want to be able to update the score during the game.
We've tried something like this below..and all sorts of other experiments. We simply want to update the global variable of score each time the function is run.
(This current version gives an error)
Thanks for any clues!
We want to be able to update the score during the game.
We've tried something like this below..and all sorts of other experiments. We simply want to update the global variable of score each time the function is run.
(This current version gives an error)
Thanks for any clues!
score = 0 def showScore(): score = score + 5 showScore() showScore() showScore()