[Tutor] Functions and lists.

lumbricus@gmx.net lumbricus@gmx.net
Wed, 14 Aug 2002 14:34:38 +0200 (MEST)


> At 16:22 2002-08-13 -0500, SA wrote:

Hello!

> >import string
> ...
> >value = string.strip(sys.stdin.readline())

This is usually done with
value=string.strip(raw_input("prompt> "))
IMHO

> Just a detail: As of Python 2.0 (or 1.6?) we
> have string methods, and can type
> 
> value = sys.stdin.readline().strip()

value=raw_input("prompt> ").strip()

> instead of
> 
> import string
> value = string.strip(sys.stdin.readline())
> 
> Unfortunately, most books are still covering 1.5.2...

Thats not so unfortunately, because many people still
get 1.5.x with the distribution. It would kill
their python ambitions when none of the example codes worked.
 
> -- 
> Magnus Lyckå, Thinkware AB
> Älvans väg 99, SE-907 50 UMEÅ
> tel: 070-582 80 65, fax: 070-612 80 65
> http://www.thinkware.se/  mailto:magnus@thinkware.se

Greetings, J"o!

-- 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net