【发布时间】:2016-09-08 20:29:35
【问题描述】:
很抱歉标题模糊,但这是我的问题。 (我刚开始这项研究)
例如
list_1 = [a, b, c, d, e, f]
input_1 = input('question1')
input_2 = input('question2')
让我们说他们选择了
input_1 = b
input_2 = f
我需要一些可以打印两个所选字母之间的字母的东西。 所以你会得到
c
d
e
我尝试将 for 语句与 if 语句一起使用,但效果不佳。 我还需要检查 input2 在列表中是否比 input1 更远的东西。我试过了
if input_2 > input_1:
print('yey')
else:
print('not recognized, automatically f')
input_2 = list_1[-1]
抱歉初学者的问题=(
【问题讨论】:
标签: python list for-loop input