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 can loop through the list and take out indices for each of the inputs then test for the conditions you want. Something like this:</p>

<pre><code>list1 = ['a', 'b', 'c', 'd', 'f']
input_1  = 'b'
input_2 =  'f'
input_1_index = -1
input_2_index = -1

for i in range(len(list1)):
    if list1[i] == input_1:
        input_1_index = i
    elif list1[i] == input_2:
        input_2_index = i

if input_1_index == -1 or input_2_index == -1 or input_1_index &gt; input_2_index:
    print('error')

else:
    print(list1[(input_1_index+1):input_2_index])
</code></pre>

python list for-loop input