Hey guys, is there a way I can get the function I am writing to randomly pick an integer or string value from a list?
Below is the example code:
def higher_lower(guess, bet):
global money
ace = 1
List1 = ['ace', 2, 3, 4, 5, 6, 7, 8, 9, 10]
Value = random.randint(1, 10)
if guess > Value:
money = money + bet
return "Congratulations, you have picked the higher card and won!\n" + "You now have £" + str(money) + " in your account."
elif guess < Value:
money = money - bet
return "Unfortunately you haven't picked the higher card and lost this time!\n" + "You now have £" + str(money) + " in your account."
else:
money
return "You have picked a card with the same value as your opponent, it is a tie!\n" + "You now have £" + str(money) + " in your account.
Any help would be greatly appreciated.