jmton 发表于 2017-5-7 06:53:53

python 代码片断,查找列表中某个数字的前后数字

#coding=utf-8
list=
mid=input("shu ru mu biao shu zi:")
try:
index=list.index(mid)
if index==0:
print None
print list
elif index==len(list)-1:
print list
print None
else:
print list
print list
except ValueError:
print None
print None
import os
os.system("pause")
页: [1]
查看完整版本: python 代码片断,查找列表中某个数字的前后数字