Click here to Skip to main content
16,008,183 members

Comments by Member 10540911 (Top 4 by date)

Member 10540911 22-Jan-14 11:00am View    
I came up with a different solution. I want to know what the % function does because there are code with that function on the internet and as i am new i have no idea what it means.
Member 10540911 22-Jan-14 5:56am View    
Now i tried again and the error isn't reported but this i what i get when i press enter:

>>>print even_list
[]
>>>print odd_list
[]

There is no output
Member 10540911 22-Jan-14 5:53am View    
in the line : print even_list

the word print gets highlighted
Member 10540911 22-Jan-14 5:45am View    
even_list = []
odd_list = []
li = range(1,21)
for i in range(len(li)):
if i/2 == 0 :
even_list.append(li[i])
else :
odd_list.append(li[i])
print even_list
print odd_list


This is what I did but keep getting invalid syntax and no output