I am making a top trump game and want to get a local variable used in a different function. This is all the necessary code. hello() is the menu but is not relevant here.
def deckcards():
cards = trumps.cards // 2
print(cards)
def trumps():
cards = int(input("""How many cards would you like?
(Even number from 4, 30): """))
if cards % 2 == 0 and cards != 0:
if cards < 4 or cards > 30:
print("Please enter an even number from 4 to 30")
hello()
else:
deckcards()
else:
print("Invalid amount.")
hello()