Apr-29-2021, 11:17 AM
(Apr-29-2021, 10:45 AM)ibreeden Wrote: Hi Jip31,
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
thanks ibredeen (sorry I have one week python background....)