my python will not run a program. it will always think that the heading is a syntax error. What can i do?
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
i didnt even write any code. all i entered as a test was print ('hello world') which return the syntax error and when i clicked ok to see the error it highlighted the 5 in the header that said 2.5.1
Not the answer you are looking for? Search for more explanations.
sadly i have no idea what that means
Put a # before any text and that makes it a comment. Comments are used for code that you want people to read and not the computer.
# Get the user's name and print a friendly hello
name = raw_input("Please enter your name ")
print "Hello", name, "- good to see you!"
Don't bother with the header at first, it's only there to let the computer know which interpreter to use. Unless you have a Python3 interpreter as the default, which is unlikely, it'll just use whatever you have set up, probably Python2.6 or 7 anyway. You can always specify an interpreter at the command line.
By the way, unless you've done
from __future__ import print_function
you shouldn't add parenthesis to your print statements.
means print a tuple containing one object, the string 'hello world'. It should print
In Python2 we just do
print 'hello world'
Note, print is a keyword in P2, but a function in P3 so
in P3 does actually mean print the string 'hello world' (by calling the print function on it).