+ 1

why below code run error at last line on sololearn’s code place?

for i in range(1,10): for j in range(1,10): for k in range(1,10): print i,j,k

10th Feb 2017, 6:40 AM
karlxu
karlxu - avatar
3 Answers
+ 6
Sololearn runs on Python 3.x syntax, where print is a function, not a statement anymore (like it is in Python 2.x). You should go with: print (i, j, k)
10th Feb 2017, 7:18 AM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 3
um... the error tells you what's wrong: you're missing parentheses. print(i,j,k) will do the job.
10th Feb 2017, 6:51 AM
Mario L.
Mario L. - avatar
0
you are missing the brackets around the print statement plus you may be exceeding the time limit
10th Feb 2017, 6:52 AM
richard