Runtime error in python 2

Revision en1, by Ali_BM, 2016-09-24 20:10:37

Hello every one . I have solved a problem with python 2 but code forces shows me runtime error . could you please tell me how i can solve this problem with code forces ? This is my code :

n = input()
array = []
a1 = []
a2 = []
for i in range(0,n) :
	temp = input()
	array.append(temp)
	if array[i] % 2 :
		a1.append(i)
	else :
		a2.append(i)
if len(a1) < len(a2) :
	print a1[0] + 1, "\n"
else :
	print a2[0] + 1, "\n"
Tags runtime error, python 2, python

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Ali_BM 2016-09-24 20:11:32 22 Tiny change: 'rces ?\nThis is ' -> 'rces ?\nThe problem is : 25A\nThis is '
en1 English Ali_BM 2016-09-24 20:10:37 485 Initial revision (published)