Re: [Tutor] How to get 4 numbers from the user in one line for easycomparision?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: [Tutor] How to get 4 numbers from the user in one line for easycomparision?

From: Alan G <alan.gauld@freenet.co.uk>
Date: Sun Jul 03 2005 - 16:03:52 CEST

> I .... Just need to figure out how to get 4 numbers from
> the player on one line for easy comparison,

Unless there is a set of batteries somewhere that I don't know
about I think you have to rely on reading the line as a string
and then splitting it.

line = raw_input('Type 4 numbers separated by spaces: ')
numbers = [int(n) for n in line.split(' ')]

HTH,

Alan G.
Received on Thu Sep 29 16:43:32 2005