创建了一个程序,可以抛硬币 100 次,每次都给出随机结果。只是想知道是否可以计算每个结果出现的次数。不知道从哪里开始。我到目前为止所拥有的......
# A program which flips a coin 100 times and tells you the outcome each time
import random
counter = 0
flip = ["true", "false"]
while counter <= 99:
counter = counter+1
print (counter)
print (random.choice(flip))