You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': n = int(raw_input()) for i in range(0,20): if (i<n): x=i*i print(x)
it works fine in python 2 in python 3 the exact code gives me
File "solution.py", line 2 int n = int(raw_input()) ^ SyntaxError: invalid syntax
Finally why i in range(0,20) when the constraint is 1<=N<=20 ?
Seems like cookies are disabled on this browser, please enable them to open this website
Loops
You are viewing a single comment's thread. Return to all comments →
it works fine in python 2 in python 3 the exact code gives me
Finally why i in range(0,20) when the constraint is 1<=N<=20 ?