Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38970 > unrolled thread
| Started by | Deborah Piotrowski <spiceninja4u@gmail.com> |
|---|---|
| First post | 2013-02-15 16:08 -0700 |
| Last post | 2013-02-15 23:14 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: New User-Need-Help Deborah Piotrowski <spiceninja4u@gmail.com> - 2013-02-15 16:08 -0700
Re: New User-Need-Help John Gordon <gordon@panix.com> - 2013-02-15 23:14 +0000
| From | Deborah Piotrowski <spiceninja4u@gmail.com> |
|---|---|
| Date | 2013-02-15 16:08 -0700 |
| Subject | Re: New User-Need-Help |
| Message-ID | <mailman.1855.1360969699.2939.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
print "Game Over"
input("\n\nPress the Enter Key to Exit")
Syntax Error: Invalid Syntax
On Fri, Feb 15, 2013 at 3:48 PM, Bob Brusa <bob.brusa@gmail.com> wrote:
>
>
> Am Freitag, 15. Februar 2013 schrieb Joel Goldstick :
>
>
>>
>>
>> On Fri, Feb 15, 2013 at 4:45 PM, Deborah Piotrowski <
>> spiceninja4u@gmail.com> wrote:
>>
>>> Hi,
>>>
>>>
>>> I am very new to Python, I am using the e-book "Python Programming for
>>> the Absolute Beginner" and am starting with a simple "Game Over" Program.
>>> This is the code:which is extremely simple!
>>> print"Game Over" raw_input("\n\nPress Enter Key to exit")
>>>
>>
>> welcome Nicholas
>>
>>
>> One important thing about python is indentation is important. You have
>> presented your code in a way that can't be. Can you actually copy your
>> program and paste it into an email message. Also, Windows, Linux, Mac?
>>
>>
>>
>>> That's it. It is supposed to bring up a window that says "Game Over" and
>>> at the bottom say "Press enter Key to exit" and when you press the enter
>>> key it is supposed to exit(big suprise).
>>> But all it does is highlight "raw_input" and says "invalid syntax" Now,
>>> if I just put "print "Game Over"" then it says Game Over UNDERNEATH the
>>> code I just printed!
>>> now I am following the book to the *pixel* and that is not what is
>>> supposed to happen!
>>> Please email me back as soon as you get this...(if you are not to busy).
>>>
>>> Thanks,Nicholas
>>>
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>>
>>>
>>
>>
>> --
>> Joel Goldstick
>> http://joelgoldstick.com
>>
>
> Nicholas,
> Could it be that you use a more recent version ( e. g. 3.3) of python? I
> found that raw_input is indeed no longer recognized. Use input instead and
> your code will work - at least it did so with python 3.3 on my iPad.
> Bob
>
>
> --
> Von Gmail Mobile gesendet
>
--
Nicholas J. Piotrowski
[toc] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2013-02-15 23:14 +0000 |
| Message-ID | <kfmfgc$5bl$1@reader1.panix.com> |
| In reply to | #38970 |
In <mailman.1855.1360969699.2939.python-list@python.org> Deborah Piotrowski <spiceninja4u@gmail.com> writes:
> print "Game Over"
> input("\n\nPress the Enter Key to Exit")
> Syntax Error: Invalid Syntax
You're probably using Python version 3, but the book was written for
version 2. The print statement is handled a bit differently in version 3.
Change your print statement to look like this:
print("Game Over")
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web