Why am I getting an error in my print statement? [Python 3]

Can someone help me figure out why I am getting an error in my code?

ar = []
ar.append ([29, 21, 33, -30])
ar.append ([39, 26, -43, 42])
ar.append ([123, 43, 33, 46])

print (ar)

for r in range(len(ar)):
    for c in range(len(ar[0])):
    print (ar[r][c])
    print ("")

What language? Python?

The language I am using is Python 3.

Ok, you have a syntax error because you did not indent after your second for. In Python, whitespace is important and has syntactic meaning.

As a side note: You don’t put space between the name of the function and the () for the argument in Python. You can but it is very unusual.

1 Like