Can you identity the Error in the program ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you identity the Error in the program ?

n, x = map(int, raw_input().split()) a = map(int, raw_input().split()) ans = 0 ans = 1 for i in xrange(n): x -= a[i] if x <= 0: break ans += 1 print ans

29th Jul 2017, 4:46 PM
Prashant Chauhan
1 Answer
+ 6
Actually, it is written for Python 2, while Sololearn's implementation uses Python 3.
29th Jul 2017, 8:25 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar