0

我正在制作一个基于文本的游戏实验以取乐,因为我大约一周前才开始学习,当我使用玩家拥有的健康值而不是 65 时,它会显示为 6.500000e+01,读起来不是很那么我该如何预防呢?这是我第一次来这里我应该发布我的整个代码吗?

if 'eat' in food:

    print "Then starts the feast, you eat everything you can reach.  After a while you become to tired and need to rest."
    print "You wake up with no sense of how much time has passed. You ate too much but feel healthier. You continue on into through the only doors you can see."
    player["health"] += 15
    print "You are now at %(health) health." % player
4

1 回答 1

1

"尝试 %d" % (玩家 ["health"])

于 2013-09-19T23:37:09.033 回答