[Tutor] simple list question
Ara Kooser
ghashsnaga at gmail.com
Mon Feb 20 23:44:23 CET 2006
Hello all,
First off thank you to all the folks that gave input on a smallpox
percolation model my students were working on last year. They won first
place in the computation division at the science fair and took home the
Intel Programming award. I can post or e-mail the code if anyone wants it.
This should be simple but I've haven't programmed in python since I
started my new job.
I am running Python 2.4 on a Windows XP machine (my linux laptop crashed).
Editing is done in Idle.
#
# Test of a room as list
# room.py
#
room = [' ', ' ', ' ', ' ',
'############',
'#.................#',
'#.................#',
'#.................#',
'#.................#',
'#####.######']
print room,
When the program runs my output is this:
>>>
[' ', ' ', ' ', ' ', '############', '#..........#', '#..........#',
'############']
Why is that? I thought that adding , after the print command would allow the
format to stay the same. Is there a better way of doing this (I like lists
because I can edit them easily)? Thanks.
Ara
--
Fatti non foste per viver come bruti, ma per seguir virtute e canoscenza -
Dante Alighieri
You were not made to live like brutes, but to pursue virtue and knowledge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060220/8fd7e6c5/attachment.html
More information about the Tutor
mailing list