https://www.chegg.com/homework-help/questions-and-answers/p6-pg-175-python-code-develop-solution-flip-coin-given-amount-times-print-number-heads-num-q36858669?trackid=ujk9DJAI
above is the link to the original question which was answeredcorrectly-
Develop a solution to flip a coin a given amount of times andthen print the number
of heads and the number of tails.
The equation to toss the coin is:
Coin = Integer(Random * 2) + 1
My pseudocode for the link above- the comment section wouldntlet me show my full code after entered in
PSEUDOCODE-
##coin flip
import random
FUNCTION FlipCount(n):
H <- 1
T <- 2
nH <- 0
nT <- 0
for i in range(n):
Coin <- int(random.random() * 2) + 1
IF Coin = H:
nH <- nH + 1
ELSEIF Coin = T:
nT <- nT + 1
ENDIF
ENDFOR
RETURN nH, nT
ENDFUNCTION
n <- 100
OUTPUT “On