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

sunrrrise sunrrrise at gmail.com
Sun May 22 18:59:06 EDT 2011


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.



More information about the Python-list mailing list