First Person to 10 wins
Flip Anikel is in charge of a dart tournament. In order to decide who goes first he decides to ask each competitor to toss a coin until they get a total of 10 heads. The person who can do this in the LEAST number of tosses gets to go first.
Write a Python function that conform to the following:
- Function name
- howManyTimes()
- Parameters
- The number of heads desired (in my example above, 10. But this should be changeable).
- Return value
- The number of times the function had to "flip a coin" before they saw the number of "heads" the number of times given in the parameter (how long to get 10 heads in my example)
- Examples
- Special Instructions
- Remember from our previous lecture that you can "flip a coin" by doing:
- Remember from our previous lecture that you can "flip a coin" by doing: