Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8495

Re: Python basic program problem

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dan.kluev@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'function,': 0.07; 'python': 0.08; '>>>>': 0.09; 'syntax': 0.11; 'received:209.85.214.174': 0.13; 'received:mail- iw0-f174.google.com': 0.13; 'wrote:': 0.15; 'tracebacks': 0.16; 'pm,': 0.16; '>>>': 0.16; 'mon,': 0.17; '2.x': 0.19; 'singh': 0.19; 'subject:problem': 0.19; 'header:In-Reply-To:1': 0.22; '"this': 0.25; 'invalid': 0.25; 'received:209.85.214': 0.28; 'message-id:@mail.gmail.com': 0.28; '27,': 0.29; '3.x': 0.30; 'version': 0.30; 'print': 0.32; 'to:addr:python-list': 0.34; 'daniel': 0.34; 'running': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'full': 0.64; 'world': 0.65; 'jun': 0.67; 'subject:program': 0.67; 'future,': 0.76
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Kd8IZbtQSM+CFvHOGKg/NxLaZ6ayEiuaSxkDQJiVJdM=; b=FoD7PDbOXHmOI63pljYChMoBWvKlY6fKAEMHlUxkJV6vm4MKPDL1ospG23FYJ5OAcH IoijCKzFOHgMzNF4z2eDJcdxyPpgZLO5gMvrs24pMUfMt28f0bgTNI96Ze3xkOJmwi71 nnYEFY9Sjz9YuTMXsvAGB8xG6H2cFcIyJj5ZY=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=cRTuFW99JgPFj+frGSyyqHgT4SC/CmyAC40PAQsmd3zjYArBkFF4FcjB+W+c1NB7p+ +kmJBcswxld0dBqFZrFxsUxoqmtQrAv1L24aRtYP3b3aUu6sxWX/IuIoQ3Ofqvda1L5I D3lW2vgwunP9xfDFRqK75c7LAKGmCiCvtLbls=
MIME-Version 1.0
In-Reply-To <c07a7df7-0e26-4884-a237-cc0a1f148056@q14g2000prh.googlegroups.com>
References <c07a7df7-0e26-4884-a237-cc0a1f148056@q14g2000prh.googlegroups.com>
Date Mon, 27 Jun 2011 18:19:32 +1100
Subject Re: Python basic program problem
From Daniel Kluev <dan.kluev@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.439.1309159175.1164.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 82.94.164.166
X-Trace 1309159175 news.xs4all.nl 4353 [::ffff:82.94.164.166]:49796
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8495

Show key headers only | View raw


On Mon, Jun 27, 2011 at 6:05 PM, Amaninder Singh <asingh0412@gmail.com> wrote:
>>>> print "this is a test"
> SyntaxError: invalid syntax

Most likely, you are running python 3.x, while reading python 2.x book.
In python 3.x print is now ordinary function,

>>> print('hello world')
hello world


In future, please include full tracebacks and python version info.

-- 
With best regards,
Daniel Kluev

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python basic program problem Amaninder Singh <asingh0412@gmail.com> - 2011-06-27 00:05 -0700
  Re: Python basic program problem Noah Hall <enalicho@gmail.com> - 2011-06-27 08:18 +0100
  Re: Python basic program problem Daniel Kluev <dan.kluev@gmail.com> - 2011-06-27 18:19 +1100
  Re: Python basic program problem Andrew Berg <bahamutzero8825@gmail.com> - 2011-06-27 02:24 -0500
  Re: Python basic program problem Noah Hall <enalicho@gmail.com> - 2011-06-27 22:28 +0100

csiph-web