Anonymous user
Boston Python workshop 2/Friday tutorial: Difference between revisions
Boston Python workshop 2/Friday tutorial (view source)
Revision as of 00:02, 27 May 2011
, 12 years ago→Types
(→Types) |
|||
Line 56:
==Types==
There's a helpful function (more on what a function is in a second) called <code>type</code> that tells you what kind of thing -- what <b>data type</b> -- Python thinks something is. We can check for ourselves that Python considers '1' and '1.0' to be different data types:
<pre>
Line 71:
So in this case 'type' is the name of the function, and it takes one argument; in the example we first give <code>type</code> an argument of 1 and then give it an argument of 1.0.
* Functions are a lot like functions in math class. You provide input to a function, and it possibly produces output. The
===Command history===
Stop here and try hitting the Up arrow on your keyboard. The Python <b>interpreter</b> saves a history of what you've entered, so you can arrow up to old commands and hit Return to re-run them!
==Variables==
|