抛10000次硬币的程序(python)
import randomobverse = 0
reverse = 0
for i in range (0, 10000):
coin = random.randint(1,2)
if coin == 1:
print('obverse')
obverse = obverse + 1
else:
print('reverse')
reverse = reverse + 1
print('obverse:' + str(obverse) + ' ' + 'reverse:' + str(reverse)) 最后的print里的str(obverse) + ' ' 的这个引号啥意思啊?是要显示一个空格?这里不能直接用\t吗? 是新手,不会
页:
[1]