How to get the value from a list + input
<p>So sorry for the vague title but this is my problem.
(I just started this study)</p>

<h2>For example</h2>

<pre><code>list_1 = [a, b, c, d, e, f]

input_1 = input('question1')
input_2 = input('question2')
</code></pre>

<p>lets say they chose</p>

<pre><code>input_1  = b
input_2 =  f
</code></pre>

<p>I need something that prints the letters between the 2 chosen ones.
So you would get</p>

<pre><code>c
d
e
</code></pre>

<p>What I tried is using the for statement with an if statement but it didnt work out very well. 
I also need something that checks if input2 is further in the list than input1. I tried with</p>

<pre><code>if input_2 &gt; input_1:
     print('yey')
else:
     print('not recognized, automatically f')
     input_2 = list_1[-1]
</code></pre>

<p>sorry for the beginner question =(</p>

<p>You probably want to use the list.index() method, you can find documentation <a href="https://docs.python.org/2/tutorial/datastructures.html#more-on-lists" rel="nofollow">here</a>.</p>

<p>In your case, this will look like </p>

<pre><code>i1 = list_1.index(input_1)
i2 = list_1.index(input_2)

if i2 &gt; i1:
    print('yey')
</code></pre>

<p>And then you can use a slice and loop to print the sublist</p>

<pre><code>sublist = list_1[i1:i2]
for c in sublist:
    print(c)
</code></pre>

python list for-loop input