Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

Python error

I want to learn Python, so I downloaded the interpreter but when I enter the simplest statement, it generates an error.

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print 'a'
SyntaxError: invalid syntax
>>> 

You can't see the colors here, but it's pointing to the single quote after a  in print 'a' is red.  The image is attached.
ee.png
0
Barry Sweezey
Asked:
Barry Sweezey
1 Solution
 
käµfm³d 👽Commented:
Python 3 requires parentheses for function calls. Prior to 3, the syntax you have is valid. Do this instead:

print('a')

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now