展示烤热狗,有些简陋
from time import sleepclass HotDog:def __init__(self):
self.cooked_level = 0
self.cooked_string = "半生不熟"
self.condiments = []
def cook(self, time):
self.cooked_level += time
if self.cooked_level > 8:
self.cooked_string = "呵呵呵,烤糊了"
elif self.cooked_level > 5:
self.cooked_string = "完美"
elif self.cooked_level > 3:
self.cooked_string = "五分熟"
else:
self.cooked_string = "半生不熟"
myDog = HotDog()
print("烹饪时间到!\n")
sleep(1)
someTime = int(input())
"""咨询下
怎么
在这里
换行
?"""
sleep(1)
print("OK\n")
sleep(1)
print("请耐心等待十五秒\n")
myDog.cook(someTime)
sleep(15)
print("看看怎么样吧!\n")
print(myDog.cooked_string)
如题
问下,加三重引号的部分的问题帮忙解决一下
int(input("\n")) qiuyouzhi 发表于 2020-6-6 17:06
咨询下,必须要加
int()
吗 from time import sleep
class HotDog:
def __init__(self):
self.cooked_level = 0
self.cooked_string = "半生不熟"
self.condiments = []
def cook(self, time):
self.cooked_level += time
if self.cooked_level > 8:
self.cooked_string = "呵呵呵,烤糊了"
elif self.cooked_level > 5:
self.cooked_string = "完美"
elif self.cooked_level > 3:
self.cooked_string = "五分熟"
else:
self.cooked_string = "半生不熟"
myDog = HotDog()
print("烹饪时间到!\n")
sleep(1)
someTime = int(input())
"""咨询下
怎么
在这里
换行
?"""
sleep(1)
print("OK\n")
sleep(1)
print("请耐心等待十五秒\n")
myDog.cook(someTime)
sleep(15)
print("看看怎么样吧!\n")
print(myDog.cooked_string)
from time import sleep
class HotDog:
def __init__(self):
self.cooked_level = 0
self.cooked_string = "半生不熟"
self.condiments = []
def cook(self, time):
self.cooked_level += time
if self.cooked_level > 8:
self.cooked_string = "呵呵呵,烤糊了"
elif self.cooked_level > 5:
self.cooked_string = "完美"
elif self.cooked_level > 3:
self.cooked_string = "五分熟"
else:
self.cooked_string = "半生不熟"
myDog = HotDog()
print("烹饪时间到!\n")
sleep(1)
someTime = int(input())
"""咨询下
怎么
在这里
换行
?"""
sleep(1)
print("OK\n")
sleep(1)
print("请耐心等待"+str(someTime)+"秒\n")
myDog.cook(someTime)
sleep(someTime)
print("看看怎么样吧!\n")
print(myDog.cooked_string 青出于蓝 发表于 2020-6-6 17:31
NONONO
from time import sleep
class HotDog:
def __init__(self):
self.cooked_level = 0
self.cooked_string = "半生不熟"
self.condiments = []
def cook(self, time):
self.cooked_level += time
if self.cooked_level > 8:
self.cooked_string = "呵呵呵,烤糊了"
elif self.cooked_level > 5:
self.cooked_string = "完美"
elif self.cooked_level > 3:
self.cooked_string = "五分熟"
else:
self.cooked_string = "半生不熟"
myDog = HotDog()
print("烹饪时间到!\n")
sleep(1)
someTime = int(input())
"""咨询下
怎么
在这里
换行
?"""
sleep(1)
print("OK\n")
sleep(1)
print("请耐心等待"+str(someTime)+"秒\n")
myDog.cook(someTime)
sleep(someTime)
print("看看怎么样吧!\n")
print(myDog.cooked_string
from time import sleep
class HotDog:
def __init__(self):
self.cooked_level = 0
self.cooked_string = "半生不熟"
self.condiments = []
def cook(self, time):
self.cooked_level += time
if self.cooked_level > 8:
self.cooked_string = "呵呵呵,烤糊了"
elif self.cooked_level > 5:
self.cooked_string = "完美"
elif self.cooked_level > 3:
self.cooked_string = "五分熟"
else:
self.cooked_string = "半生不熟"
myDog = HotDog()
print("烹饪时间到!\n")
sleep(1)
someTime = int(input())
"""咨询下
怎么
在这里
换行
?"""
sleep(1)
print("OK\n")
sleep(1)
print("请耐心等待"+str(someTime)+"秒\n")
myDog.cook(someTime)
sleep(someTime)
print("看看怎么样吧!\n")
print(myDog.cooked_string) 靳子轩 发表于 2020-6-6 17:41
int整形。str字符串类型。还有什么疑问吗....
你这里所说的换行是什么意思...有点没明白
Twilight6 发表于 2020-6-6 17:45
你这里所说的换行是什么意思...有点没明白
就是使用\n来换行啊 靳子轩 发表于 2020-6-6 19:06
就是使用来换行啊
你想达到什么目的,如果单纯 \n 那么 2楼已经满足条件吧了 青出于蓝 发表于 2020-6-6 17:43
int整形。str字符串类型。还有什么疑问吗....
我想使用\n来在运行时换行 Twilight6 发表于 2020-6-6 19:07
你想达到什么目的,如果单纯 \n 那么 2楼已经满足条件吧了
我想在输入完之后换一行 靳子轩 发表于 2020-6-6 19:10
我想在输入完之后换一行
那再 input 下面加个print()即可了 里面什么都不填 大神看看
查询错误,求指教
https://fishc.com.cn/thread-171461-1-1.html
(出处: 鱼C论坛)
页:
[1]