I just finished learning the Python syntax at Codeacademy and decided to try and do some bits in Python proper. So I download the latest version and although my code works on Codeacademy it doesn't work in this (I assume they are different). What I'm trying to do is get the numbers appended to the list, sum them and the print the result. Here's what I wrote:
num = []
for x in range(1,11):
if x%3==0 or x%5==0:
num.append(x)
print num
print sum(num)
What's wrong? I get a syntax error with an arrow under the 't' in 'print'.
This still doesn't work when I change the print part...so something else in the code must be wrong but it still tells me it's a print error.