Chapter 8: Problem 1
Flip a coin \(N\) times. Make a program that simulates flipping a coin \(N\) times. Print out "tail" or "head" for each flip and let the program count the number of heads. (Hint: Use \(\mathrm{r}=\) random random () and define head as \(\mathrm{r} \Leftrightarrow 0.5\) or draw an integer among \(\\{1,2\\}\) with \(r=\) random . randint \((1,2)\) and define head when \(r\) is 1.) Name of program file: flip_coin.py.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.