Question: please write pythone code 4. Write a program to flip a coin 100 times. If it lands on heads, you win, otherwise you lose. Each

please write pythone code please write pythone code 4. Write a program to flip a coin

4. Write a program to flip a coin 100 times. If it lands on "heads", you win, otherwise you lose. Each time you flip the coin, print out the result. Each time you win, print out You win!" on a separate line and add $10 to your wallet. Each time you lose, print out "You lose!" on a separate line and deduct $10 from your wallet. Start with $500.00 in your wallet. At the end of iterations of the loop, print out on separate lines, the number of heads, the number of tails, and the total in your wallet. Sample output The coin landed on heads You WIN! The coin landed on heads. You WIN! The coin landed on tails. You LOSE! Number of Heads 55 Number of Tails: 45 You now have $600.0 in your wallet

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!