迷糊了已经下面的while循环怎么都跳不过去,要么只执行一次,要么就一直循环,这个while循环不会被中断额:
print("\n\n" + "*"*10 + "模拟电视的点播功能"+ "*"*10)
class Tv:
list_movie = ["天线宝宝","花园宝宝","小猪佩奇","米奇妙妙屋","猪猪侠","熊出没"]
def __init__(self,show):
self._show = show
@property
def show(self):
return self._show
@show.setter
def show(self,value):
if value in Tv.list_movie:
self._show = "您点播了:" + value
else:
self._show = "无此电影"
tv = Tv("熊出没")
print("正在播放:",tv.show)
print("可以点播的电影:\n",Tv.list_movie)
ttv = True
while ttv == True:
tv.show = str(input("请选择要点播的电影:"))
print(tv.show)
if tv.show in Tv.list_movie:
ttv = False
else:
continue