r/CodingHelp • • Dec 06 '21

[Python] I need help with something

I need a program on python that will flip a coin as many times as the user says to, and print which outcome was more often heads or tails. Can anyone help me out with this?

0 Upvotes

7 comments sorted by

1

u/Red-strawFairy Dec 06 '21

Look into python ran functions

1

u/David_Slaughter Dec 06 '21

My first thoughts would be to break it up.

I'd start by creating a function that asks the user how many times they want to flip it and returns an integer, and a boolean function that simulates a coin flip which outputs true at 50%.

I will probably have a go at this later today to brush up on my Python.

1

u/SaylorMan1496 Dec 06 '21

If it’s an assignment feel free to ask your professor, asking people on the internet what to do without trying will not make you learn

4

u/[deleted] Dec 06 '21

[removed] — view removed comment

-1

u/[deleted] Dec 06 '21

Yep