Learning with python though examples<br><br>

Microsoft Windows XP [Version 5.1.2600]<br>
(C) Copyright 1985-2001 Microsoft Corp.<br>
C:\\>python<br>
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32<br>
Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.<br>
>>> print \"HELLO\" # Number signs will comment<br>
HELLO<br>

<br>
>>> name = \"Cotton\" <br>
# the variable \"name\" has been defined to the string \"Cotton\"<br>
>>> def hello():<br>
...     print \"Hello there, %s\"%name<br>
...	<br>
# hello() is now a function<br>
>>> hello()<br>
Hello there, Cotton<br>

<br>
# alittle more complicated<br>
<br>
>>> def hello2(user): # we now made \"user\" and argument. <br>
...     print \"Hello there, %s\"% user<br>
...<br>
>>> hello2() <br>
# U cannot call hello2(user) without an argument. <br>
Traceback (most recent call last):<br>
  File \"<stdin>\", line 1, in ?<br>

TypeError: hello2() takes exactly 1 argument (0 given)<br>
<br>
>>> hello2(\"infonomicon\")<br>
Hello there, infonomicon<br>
<br>
>>> nicks = [\"John\",\"Billy\", \"Python\", \"Cotton\", \"twat\"] #nicks has been defined as a list<br>
>>> nicks<br>
[\'John\', \'Billy\', \'Python\', \'Cotton\', \'twat\']<br>
>>> for i in nicks:<br>
...     hello2(i)<br>

...<br>
Hello there, John<br>
Hello there, Billy<br>
Hello there, Python<br>
Hello there, Cotton<br>
Hello there, twat<br>
<br>
# For more help, visit http://www.ibiblio.org/obp/thinkCSpy/ That site has helped me tremendously! <br>
# Email me cbmailone[at]gmail[dot]com<br>
Great Python Tutorials:<br><br>
<a href=\"http://www.ibiblio.org/obp/thinkCSpy/\">http://www.ibiblio.org/obp/thinkCSpy/</a><br>
<a href=\"http://www.ibiblio.org/g2swap/byteofpython/read/index.html\">http://www.ibiblio.org/g2swap/byteofpython/read/index.html</a><br>
<a href=\"http://diveintopython.org/toc/index.html\">http://diveintopython.org/toc/index.html</a><br