Ask coding questions

← Back to all posts
How do I do this???
THEGOLDENTHRONE

Does anyone know how to make it so that python prints how many times a function returns a value from a random.choice function?
Here's the code:

I've tried everything, but I can't figure out how to make it work. HELP!

Voters
THEGOLDENTHRONE
Comments
hotnewtop
MrVoo

Do you mean if you run a function once, the value will be 1, but if you run it three times, the value will be three?

THEGOLDENTHRONE

No, I mean that if I run the function 20 times, it returns how many times the output is 2, or how many times the output is 1.

THEGOLDENTHRONE

I think I have it figured out though, I'll test it and then comment whether or not that worked here

THEGOLDENTHRONE

It didn't work

THEGOLDENTHRONE

Making all the decimals whole numbers didn't work

MrVoo

@THEGOLDENTHRONE Make a dictionary or ultimate variables and increase each value based on the result