Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49509 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2013-06-30 13:07 -0600 |
| Last post | 2013-06-30 13:07 -0600 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: math functions with non numeric args Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-30 13:07 -0600
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2013-06-30 13:07 -0600 |
| Subject | Re: math functions with non numeric args |
| Message-ID | <mailman.4038.1372619286.3114.python-list@python.org> |
On Sun, Jun 30, 2013 at 12:46 PM, Andrew Z <formisc@gmail.com> wrote:
> Hello,
>
> print max(-10, 10)
> 10
> print max('-10', 10)
> -10
>
> My guess max converts string to number bye decoding each of the characters
> to it's ASCII equivalent?
No, it leaves the types as they are but simply considers strings to be
"greater than" numbers. As another poster stated, this is fixed in
Python 3, where strings and numbers are considered inorderable.
Back to top | Article view | comp.lang.python
csiph-web