Q:

Finding 2 middle numbers in a list of 4 numbers in Python

I want to write a script that gets 4 numbers and print the 2 middle ones.  
I tried something but it does not work well: 
a = (input('enter first num:'))
b = (input('enter second num:'))
c = (input('enter thirs num:'))
d = (input('enter forth num:'))

##a=float(a)
##b=float(b)    
##c=float(c)
##d=float(d)

List=[a,b,c,d]
L=[]
for i in List:
        if i >> min(List):
            if i << max(List):
              L.append(i)
print L

I am not sure what the problem is because the output list is not coherent and actually depends on the input.  
I would like to get a clue or idea how to solve this (with using only lists, for and if - this is basic level course for non-programmers)

A:

this should work.  It finds the minimum and maximum element in the list and removes them from the list leaving the middle two. 
a = int(input('enter first num:'))
b = int(input('enter second num:'))
c = int(input('enter thirs num:'))
d = int(input('enter forth num:'))

L = [a, b, c, d]

minimum = a
maximum = d
for i in L:
    if i < minimum:
        minimum = i
    if i > maximum:
        maximum = i
tmp = L[:]
tmp.remove(minimum)
tmp.remove(maximum)
print tmp

Note: this will only remove the minimum and maximum numbers and will only leave two numbers if the list is of size 4
Here is another way to do it using the sort function which sorts the list in place and then you can just grab the elements by index.  
a = int(input('enter first num:'))
b = int(input('enter second num:'))
c = int(input('enter thirs num:'))
d = int(input('enter forth num:'))

L=[a,b,c,d]

L.sort()
print L[1]
print L[2]

If you want to add them to a list instead you could do
new_L = [L[1], L[2]]

A:

Your if statements are not behaving as you'd expect. 
'>>' and '<<' are not comparison operators.  They are bitwise operators. 
You simply want to use '>' and '<' to compare values.