用户:
一只红蒂罢了查看:0 回复:2 评论:0 创建时间:2020-09-07T21:58:55
【作品展示】

【作品介绍】
大家好啊!我是S喵收容失效207!
小型列表终端是一个在控制台模拟列表的程序!
希望大家喜欢!
格式:
添加:append:str/int/float:数据
删除:del:remove/pop(索引)
del:del L会删除列表,
此外还有indebug这个东西,
玩得开心!
【作品源代码】
a = []
while True:
try:
print('list:',a)
b = input()
if (b == 'indebug'):
print('欢迎使用“indebug”!')
print('“小型列表终端”的作者“S喵收容失效207”为了快速创建列表加入了“indebug”!')
print('“indebug”会将你的列表强行设置为"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"!')
print('请谨慎使用“indebug”!')
a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
if (b == 'S喵-207'):
print('你好啊!欢迎使用“小型列表终端”!')
print('我是作者“S喵收容失效207”!')
print('希望你玩的开心!')
else:
b = b.split(':')
if (b[0] == 'append'):
if (b[1] == 'str'):
a.append(str(b[2]))
elif (b[1] == 'int'):
a.append(int(b[2]))
elif (b[1] == 'float'):
a.append(float(b[2]))
else:
pass
elif (b[0] == 'del'):
b = b[1][4]
if (b == 'L'):
print('你真的要这么做?这样会使列表被删除!')
print('1、我知道我在做什么! 2、算了算了。')
if (input() == '1'):
del a
print('已删除!')
else:
pass
else:
del a[int(b)]
else:
pass
except ValueError:
print('×————程序错误检测————×')
print('你投放了错误的数据类型!')
print('√————程序错误检测————√')
except NameError:
print('×————程序错误检测————×')
print('由于你删掉了列表,所以程序无法继续运行。')
print('需要再次创建一个列表吗?')
print('1、当然要! 2、不要。')
if (input() == '1'):
a = []
else:
print('√————程序错误检测————√')
break
print('√————程序错误检测————√')
else:
print('√————程序错误检测————√')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn