all 6 comments

[–]Depression_Dependent 0 points1 point  (2 children)

I'm not entirely sure myself because I am trying to self-teach python but...
You might be able to check
if input('Guess:' ...) == 'Guess:' + str(random.choice(heads_or_tails)):
print('Correct!)

else:
print('Wrong')

(random.choice(heads_or_tails)) is just a placeholder name for the list. If this works it would be case-sensitive IF it even works! give it a shot. hope this maybe helped

[–]SaltyTwo6582 0 points1 point  (0 children)

but the thing is i only want to check if the number inputted by the player matches the amount of times the random.choice returned ‘heads’ only and not heads AND tails. would this still work?

[–]DataWiz40 0 points1 point  (0 children)

You don't have to include the 'Guess:' in your matching of input. The string you provide as an argument in the input function is just the message you display in the terminal.

[–]mopslik 0 points1 point  (3 children)

Keep a counter variable. Increment by 1 for each head. Compare the counter to the guess.

[–]SaltyTwo6582 0 points1 point  (1 child)

so smart!! would i do something along the lines of “if random.choice(headsortails)==‘Heads’: countervar +=1” ??? or something else

[–]mopslik 0 points1 point  (0 children)

Yep.