I have done some changes in your code. Result as you required. [0.5, 2, 0.75, 12].
def numprogram(l):
temp = list()
count = 0
for i in l:
count +=1
if i % 2 == 0:
l = i * (i-1)
temp.append(l)
else:
l = i/float((i+1))
temp.append(l)
return temp
print numprogram([1,2,3,4])