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


Groups > comp.lang.python > #6020 > unrolled thread

Odp: Re: Strange behaviour of input() function (Python 3.2)

Started bysunrrrise <sunrrrise@gmail.com>
First post2011-05-22 15:59 -0700
Last post2011-05-22 15:59 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Odp: Re: Strange behaviour of input() function (Python 3.2) sunrrrise <sunrrrise@gmail.com> - 2011-05-22 15:59 -0700

#6020 — Odp: Re: Strange behaviour of input() function (Python 3.2)

Fromsunrrrise <sunrrrise@gmail.com>
Date2011-05-22 15:59 -0700
SubjectOdp: Re: Strange behaviour of input() function (Python 3.2)
Message-ID<mailman.1937.1306105149.9059.python-list@python.org>
Thank you for quick response!

English is not my native language so I'm going to keep my explanations simple. 

This really simple script asks me for two variables called "a" and "b". For example, I type "4" for "a" and "3" for "b" and IDLE gives me that:

Wprowadz zmienna a: 4
Wprowadz zmienna b: 3
a to:  4
b to:  3
7

Works fine!

But when I'm using Notepad (or Komodo) I get this:

Wprowadz zmienna a: 4
Wprowadz zmienna b: 3
Traceback (most recent call last):
  File "c:\users\sunrrrise\Desktop\test.py", line 7, in <module>
    print(int(a) + int(b))
ValueError: invalid literal for int() with base 10: 'Wprowadz zmienna b: 3'
a to:  4
b to:  Wprowadz zmienna b: 3

This is exactly the same script from the same file. I really don't get it.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web