Oct-26-2020, 06:57 PM
Please fix the opening tag. Should just be python in brackets. Click the python icon button to insert them automatically.
Each time you call random.choice(insieme), you're making a new choice. Often rather than rechoosing, you want to make one choice, remember it, then do your comparisons against that choice. Otherwise you might pick the second one on the first check (so it doesn't print), then on the second check it picks the first choice. You might never match any of them. By remembering the choice, you know you should match one of them.
Something like:
Each time you call random.choice(insieme), you're making a new choice. Often rather than rechoosing, you want to make one choice, remember it, then do your comparisons against that choice. Otherwise you might pick the second one on the first check (so it doesn't print), then on the second check it picks the first choice. You might never match any of them. By remembering the choice, you know you should match one of them.
Something like:
mychoice = random.choice(insieme) if (mychoice) == 'forbice': print('Hai perso :(') elif (mychoice) == 'carta': print('Pareggio') elif (mychoice) == 'sasso': print('Hai vinto!!')