Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 Online
OpenStudy (anonymous):

I am using Python 3.2 and when I input an example that the professor uses from his first lecture video, I am getting a syntax error:invalid syntax. the example is: print 52*7. I notice for him it gives him a value but when I do it, it simply gives that error. any idea why? because of the different versions maybe? please help, thanks.

OpenStudy (anonymous):

Hey. The thing is he is using the older version of Python, 2.7.x, and as you mentioned, you are using 3.2. The thing with 3.x version is that it is not backwards compatible with 2.x, although most things are still the same. Print function is one of the functions which are changed, and in order to print you now have to put things into brackets, like this: print(52*7) or print('This is an example") I am also using the 3.2 to follow and have encountered the same issue at the beginning, but was able to solve it with a bit of Google help :)

OpenStudy (anonymous):

Feel free to ask questions here as well. I'd be happy to help with general python issues not necessarily just ones associated with the assignments...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!