Skip to content
Sign upLog in
ā† Back to Community

How do I do a 50% chance?

Profile icon
brogen

I want to make a eating contest you can enter in and I need to know how to do chance statements.
šŸ·šŸ–šŸ½

Pigs are the best!

You can play the game now but it needs updates.

Answered by DynamicSquid [earned 5 cycles]
View Answer
Voters
Profile icon
ArmonManshadi
Profile icon
brogen
Comments
hotnewtop
Profile icon
DynamicSquid

You can use a random number generator for that

import random num = random() # generate random decimal between 0 and 1 if num < 0.5: # do something else: # do something
Profile icon
brogen

@DynamicSquid

Thanks for helping me. Did you play the game? If so did you like it?

Profile icon
brogen

@DynamicSquid

me cding gif

Profile icon
DynamicSquid

@brogen
It's pretty cool!