Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'else:': 0.03; 'argument': 0.05; 'subject:Python': 0.06; 'string': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '32,': 0.16; 'dangerous,': 0.16; 'data...': 0.16; 'eof': 0.16; 'exited': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:program': 0.16; 'syntaxerror:': 0.16; 'unexpected': 0.16; 'used:': 0.16; 'wed,': 0.18; 'input': 0.22; '(in': 0.22; 'print': 0.22; '2.x': 0.24; 'url:home': 0.24; 'define': 0.26; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; '"",': 0.31; 'file': 0.32; 'probably': 0.32; '(most': 0.33; 'subject:with': 0.35; 'but': 0.35; "didn't": 0.36; 'charset:us- ascii': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'prompt': 0.68; 'computers': 0.72; 'subject:get': 0.81; 'loose': 0.84; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: I just wrote my first Python program a guessing game and it exits with an error I get this. Date: Wed, 05 Jun 2013 19:45:22 -0400 Organization: > Bestiaria Support Staff < References: <498fb115-8568-478d-8443-1be20dd5c335@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-73-119-141.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370476205 news.xs4all.nl 15959 [2001:888:2000:d::a6]:33801 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47162 On Wed, 5 Jun 2013 07:40:52 -0700 (PDT), Armando Montes De Oca declaimed the following in gmane.comp.python.general: > Traceback (most recent call last): > File "Guessing_Game.py", line 32, in > input (enter) > File "", line 0 > ^ > SyntaxError: unexpected EOF while parsing > ------------------ > (program exited with code: 1) > This is the only place a string is used: > else: > print "Sorry you loose the game." The word is "lose" ("loose" is when your T-shirt is three sizes too big) > computernum = str(computernum) > print " The computers number was!"+ computernum > input (enter) 1) In Python 2.x this is dangerous, you probably want raw_input (in 3.x, it IS raw_input) 2) input is a function that returns data... data = input() 3) Argument to input is a PROMPT string to be displayed, but you didn't define "enter". -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/