Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #105187
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jussi Piitulainen <jussi.piitulainen@helsinki.fi> |
| Newsgroups | comp.lang.python |
| Subject | Re: Beginner Python Help |
| Date | Fri, 18 Mar 2016 09:44:19 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 32 |
| Message-ID | <lf537roxmb0.fsf@ling.helsinki.fi> (permalink) |
| References | <101edd27-17e1-497c-a60f-fa56b033563b@googlegroups.com> <mailman.303.1458285656.12893.python-list@python.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="27853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fF1HXuinEtXr9mw1sKHKHk+PfxFdYtIA=" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:bsB+SrA+NqzjYb2KB/kFul3RI+M= sha1:94ygbLTiETm7NskBIIAnkMWQDQw= |
| Xref | csiph.com comp.lang.python:105187 |
Show key headers only | View raw
Terry Reedy writes: > On 3/18/2016 3:04 AM, Alan Gabriel wrote: ... >> list1=(num.split()) > > list1 is a list of strings > >> maxim= (max(list1)) >> minim= (min(list1)) > > min and max compare the strings as strings, lexicographically > >> print(minim, maxim) ... > You failed to convert strings of digits to ints. Try > > list1 = map(int, num.split) > > This will raise TypeError on strings that cannot be converted. Written in a hurry? :) Surely it'll raise something about a method not being iterable, and when that is fixed, something about not being able to invent a minimum for an empty sequence. list1 = list(map(int, num.split()))
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Beginner Python Help Alan Gabriel <alanunny@gmail.com> - 2016-03-18 00:04 -0700
Re: Beginner Python Help Terry Reedy <tjreedy@udel.edu> - 2016-03-18 03:20 -0400
Re: Beginner Python Help Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-18 09:44 +0200
Re: Beginner Python Help Chris Warrick <kwpolska@gmail.com> - 2016-03-18 08:23 +0100
Re: Beginner Python Help Ben Finney <ben+python@benfinney.id.au> - 2016-03-18 18:26 +1100
Re: Beginner Python Help "Martin A. Brown" <martin@linux-ip.net> - 2016-03-18 00:50 -0700
csiph-web