【发布时间】:2021-11-04 22:58:42
【问题描述】:
我对基本的简单 python 有疑问。所以我正在做一个记忆游戏,我想显示对象,延迟 5 秒后,让文本消失。
import time
print("Welcome to the memory game.")
print("Choose difficulty level :")
print("1. Easy")
print("2. Medium")
print("3. Hard")
print("4. Very Hard")
x = input("press '1' for easy, '2' for medium, '3' for hard and '4' for very hard : ")
if x == '1' :
print("You chose level 1, easy.")
print("I will give you 3 objects and you have to type then in the correct order to gain points.")
print("Not cAsE SeNSitIvE")
obj = print("Ship, Money, Python")
time.sleep(5)
ez = input().upper
if ez == 'Ship, Money, Python' or ez == 'ship,money,python' or ez == 'Ship,Money,Python' or ez == 'ship, money, python' :
print("Correct")
else :
print("Wrong")
print("The answer was : Ship, Money, Python")
这是代码的一部分。请帮我在这里????我想隐藏文字
obj = print("Ship, Money, Python")
延迟 5 秒后。
【问题讨论】:
-
谁能帮帮我?
-
如果你想从终端清除文本,你可以休眠 5 分钟,然后使用 clear 命令。 os.system('cls' if os.name == 'nt' else 'clear') 你必须导入 os 并休眠
-
这能回答你的问题吗? :stackoverflow.com/questions/5290994/…
-
让我看看@AlexeyLarionov
-
呃,不,你能不能再给我一个解决方案
标签: python