python编写程序模拟硬币的投掷、假设0表示硬币的反面_修改了Python中的硬币投掷程序,无法完成循环...

谢谢你们的帮助!以下是完整的代码:D'''_MBE_CIS-115-09Lab 6-1Write a python program, using modules / functions, to simulate flippinga coin using a random number generator.If the random number generator returns a 0 cons...
摘要由CSDN通过智能技术生成

谢谢你们的帮助!以下是完整的代码:D'''

_MBE_

CIS-115-09

Lab 6-1

Write a python program, using modules / functions, to simulate flipping

a coin using a random number generator.

If the random number generator returns a 0 consider that a “tails”,

and a return of a 1 a “heads”.

At the beginning of the program ask the user how many times to flip the coin,

keep track of the total “heads” and “tails” and print the results after

the coin has been flipped the requested number of times.

Allow the user to enter another number of times to flip the coin

and re-run the program.

An input of zero (0) times to flip the coin will terminate the program.

'''

print; printHeader = raw_input("Please enter your name: ")

print; print printHeader, "| Lab 6-1"; print

raw_input("Press

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值