Reputation: 41503
Can anyone tell me what is wrong with this? I'm getting a syntax error after the 2nd quote on the print
line... It seems like this should work perfectly fine. Thanks
def main():
print "blah"
return
main()
Upvotes: 0
Views: 738
Reputation: 34698
Remember if your using python 2.x then to help with the transition you can always have
from __future__ import print_function
At the top of your code, this will convert print into a function meaning 2.x code can be written with
print('This')
And run happily
Upvotes: 1
Reputation: 71004
You're using python 3.
use
print("blah")
The print
statement turned into the print
function in the transition.
Upvotes: 4
Reputation: 46745
In case you're using Python 3, the print
statement is gone in that version and you need to use the print()
function.
See: http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function
Upvotes: 4
Reputation: 48720
Posting the exact error you get would be very helpful. I'm going to assume that this is an indentation error though. Don't mix tabs and spaces.
Upvotes: 0