Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80903
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <oquanox@gmail.com> |
| 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; '"this': 0.03; 'causing': 0.04; '"the': 0.07; 'error:': 0.07; 'great.': 0.07; '")': 0.09; 'here?': 0.09; 'main()': 0.09; 'parsing': 0.09; 'python': 0.11; 'def': 0.12; 'c):': 0.16; 'eof': 0.16; 'finds': 0.16; 'main():': 0.16; 'script,': 0.16; 'subject:import': 0.16; 'syntaxerror:': 0.16; 'unexpected': 0.16; 'wrote:': 0.18; 'library': 0.18; 'thanks.': 0.20; 'seems': 0.21; 'import': 0.22; 'email addr:gmail.com>': 0.22; 'print': 0.22; 'math': 0.24; 'skip:" 40': 0.26; 'to:2**1': 0.27; 'idea': 0.28; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; '"",': 0.31; 'correctly.': 0.31; 'anyone': 0.31; 'file': 0.32; 'run': 0.32; 'url:python': 0.33; '(most': 0.33; '"the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'library.': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'error.': 0.37; 'wrong': 0.37; 'skip:& 10': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'real': 0.63; 'to:addr:gmail.com': 0.65; 'here': 0.66; '11.': 0.74 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=ESBF+mDW6kMZFdT7C1RCpR8jdu7dlGCRPGh0YXkc+/Q=; b=VBJegl+oIauuGf7pIeJ5bQor5l2LCro0eLVT9BeyNgYe6l+I+LjHsMjzEnVsJOkXuL eNS5eFJ/0d0O8wD2dARGUKOYdyyf1eyzz4okc5unxR6n40DQuIb8R59Qu3r1nI+rNTXO 0aypyQghMOaDhqAOUNLSN0Ted6Y2bwRWK64tS8XlQ3yihkwEgH7dKLjOhErlD02gQBfX 8WhtjlPuhNsvItuHpSca80nvf3UiBMLAf/kZzQoxKP7vZ45YGcPnglfnaeNnFL2N9qRt UB/WjVPZig6hOWrhcQubpw7mm6qyxBKTHWDWdgjkvCV+/f/LhIO5sNza4QC2HzNBTtCQ jZ9Q== |
| X-Received | by 10.236.15.103 with SMTP id e67mr21583730yhe.22.1416170918061; Sun, 16 Nov 2014 12:48:38 -0800 (PST) |
| MIME-Version | 1.0 |
| References | <a25f78c5-aa53-406f-a828-288ee4f7dcc5@googlegroups.com> |
| From | Mayank Tripathi <oquanox@gmail.com> |
| Date | Sun, 16 Nov 2014 20:48:37 +0000 |
| Subject | Re: import math error |
| To | ryguy7272 <ryanshuell@gmail.com>, python-list@python.org |
| Content-Type | multipart/alternative; boundary=089e0122a476832f760507fffc3c |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15900.1416170926.18130.python-list@python.org> (permalink) |
| Lines | 97 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1416170926 news.xs4all.nl 2899 [2001:888:2000:d::a6]:53715 |
| X-Complaints-To | abuse@xs4all.nl |
| X-Received-Bytes | 7100 |
| X-Received-Body-CRC | 778147547 |
| Xref | csiph.com comp.lang.python:80903 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Why the colon in '(1,1,2)'?
On Mon Nov 17 2014 at 1:41:10 AM ryguy7272 <ryanshuell@gmail.com> wrote:
> When I type 'import math', it seems like my Python recognizes this
> library. Great. When I try to run the following script, I get an error,
> which suggests (to me) the math library is not working correctly.
>
> Script:
> import math
> def main():
> print "This program finds the real solutions to a quadratic"
> print
> a, b, c = input("Please enter the coefficients (a, b, c): ")
> discRoot = math.sqrt(b * b - 4 * a * c)
> root1 = (-b + discRoot) / (2 * a)
> root2 = (-b - discRoot) / (2 * a)
> print
> print "The solutions are:", root1, root2
> main()
>
> Error:
> Traceback (most recent call last):
> File "C:\Users\Ryan\Desktop\QuadraticEquation.py", line 11, in <module>
> main()
> File "C:\Users\Ryan\Desktop\QuadraticEquation.py", line 5, in main
> a, b, c = input("Please enter the coefficients (a, b, c): ")
> File "<string>", line 1
> (1,1,2):
> ^
> SyntaxError: unexpected EOF while parsing
>
> The last line is line 11. It seems like I need this, but that's what's
> causing the error. Does anyone here have any idea what is wrong here?
>
> Thanks.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
import math error ryguy7272 <ryanshuell@gmail.com> - 2014-11-16 12:07 -0800 Re: import math error Mayank Tripathi <oquanox@gmail.com> - 2014-11-16 20:48 +0000 Re: import math error Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-16 14:41 -0700 Re:import math error Dave Angel <davea@davea.name> - 2014-11-16 17:55 -0500
csiph-web