Python(如何使文本在python shell中显示得更慢)

时间:2018-12-05 15:45:11

标签: python text

我正在尝试编写游戏代码,但我一直试图使python shell中的打印速度变慢,我很感激到目前为止提供的所有帮助

print ("welcome to the music guessing game")
print (" begin?")

print (" first of all lets go through the rules")

print (" You have three 3 lives to answer each song in this game")
print (" If you get it on the first turn you gain 3 points")
print (" if you get it on the second try you gain 1 point")
print ( " If you get it wrong again you lose one life and it proceeds to the next question")
print (" One major rule have fun while playing")


username=input (" what is your username")
print ("Is this your name ?",username)

password=input (" Enter your password please")
print (" password gained",password)

print ("Checking the data files")
print ("10%")
print ("20%")
print ("30%")
print ("40%")
print ("50%")
print ("60%")
print ("70%")
print ("80%")
print ("90%")
print  ("100%")
print (" check complete")

import random
def fifty_fifty():
        "return 0 or 1 or 2 or 3 or 4 or 5 or 5 with 50% chance each"
        return random.randrange

print (" High Scores!!!!!")

print ("[DEV]LB123 score 1200")
print (" PewDiePie score 420")
print (" Callmekevin score 68")
print ("[BOT] Tseries score 0")



option=input ("would you like to play")
print ("would you like to play "+ option +"?")

我从https://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html

获得了这些信息。
print (" okay then lets begin ")



print (" Round One " )


print (" Lets begin " )

print ("3")
print ("2")
print ("1")



print (" 'N_ Te_rs L_ft _o _r_'")

if input (" No Tears Left To Cry")
 print ("3 points")

elif input (" no answer")
print (" 1 life gone 2 remain") 

问题是,如何使文本在python shell中的显示速度变慢?谢谢

1 个答案:

答案 0 :(得分:0)

您可以在代码中添加sleep

也欢迎您!以后,请正确格式化代码,以使其正确显示。您可以在this meta post

上看到各种方式