vendredi 19 août 2016

Adding up Random int as it it created

I'm trying to get the computer to save it's random outputs then add them. Example: ran_num = 1 ran_total = 1 ran_num = 3 ran_total = 4 etc... This is all in a while loop. So until the ran_total reaches a certain number it will continue to add those numbers. This is the part of the code I'm trying to fix.

  if player_bet <= Player.total_money_amount:

   import random
   computer_choice = random.randint(1, 5)
   computer_choice_total =+computer_choice # Over Here
   print('Computer choice: ', computer_choice)
           print("Total Amount", computer_choice_total)

    player_yes_or_no = input('Continue? Yes or No')
        if player_yes_or_no == 'Yes':




Aucun commentaire:

Enregistrer un commentaire