I have this piece of code here. Let's focus on the total
variable.
def start():
global total
total = "$" + str(input("Please enter the amount you want set as your total"))
if total < 0:
print("no negative values, try again.")
start()
else:
bets()
Would it be better to return
this variable or turn it into a global
variable like I already did: global total
. Both the return
and global
keywords feature very similar use cases and so I was wondering whether I should worry about choosing which way I should make that variable accessible to other code