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


Groups > comp.lang.python > #49200

Re: newbie EOL while scanning string literal

Date 2013-06-25 17:35 -0500
From Andrew Berg <robotsondrugs@gmail.com>
Subject Re: newbie EOL while scanning string literal
References <da2378bb-e76b-4720-8071-784c717a8c38@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3855.1372199747.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 2013.06.25 17:19, willlewis965@gmail.com wrote:
> na=('type first integer n\')##THE RED SHADOW APPEARS HERE##
Here you escape the closing single quote. \n is a line feed, not n\. Also, the parentheses are unnecessary, and it looks like you are a
assigning a tuple instead of a string.
Syntax errors are often the result of typos; IDEs can easily detect such problems and will highlight them for you to make them obvious.
>     int(naa)
Strings are immutable; this returns an integer, but you don't assign it to anything.
> is_triangle(na,ne,ni)
And here, you pass the strings you assigned for the input prompt instead of the integers you wanted to get.

BTW, if you have an error, it helps if you copy/paste the full traceback. Many times, the exact issue is laid out in the traceback, and the
solution is obvious to those with experience.
-- 
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1

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


Thread

newbie EOL while scanning string literal willlewis965@gmail.com - 2013-06-25 15:19 -0700
  Re: newbie EOL while scanning string literal willlewis965@gmail.com - 2013-06-25 15:25 -0700
  Re: newbie EOL while scanning string literal Andrew Berg <robotsondrugs@gmail.com> - 2013-06-25 17:35 -0500
  Re: newbie EOL while scanning string literal rurpy@yahoo.com - 2013-06-25 15:37 -0700
  Re: newbie EOL while scanning string literal rurpy@yahoo.com - 2013-06-25 16:44 -0700
    Re: newbie EOL while scanning string literal willlewis965@gmail.com - 2013-06-25 17:05 -0700
      Re: newbie EOL while scanning string literal rusi <rustompmody@gmail.com> - 2013-06-25 20:38 -0700
      Re: newbie EOL while scanning string literal Larry Hudson <orgnut@yahoo.com> - 2013-06-25 21:47 -0700
      Re: newbie EOL while scanning string literal Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-26 08:31 +0000

csiph-web