Hi Jip31,
Although it is right what Perfringo said, for the purpose of studying: what your code gives me is the following:
Although it is right what Perfringo said, for the purpose of studying: what your code gives me is the following:
Error: File "forum03.py", line 3
print a[x]
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(a[x])?
print a[x]
is old Python 2 syntax. In Python 3 "print()" is a function. When you correct this:a = [1, 2, 3, 4, 5] for x in range(len(a)): print(a[x])... the result is:
Output:1
2
3
4
5