Boston Python Workshop 3/Data types: Difference between revisions

no edit summary
imported>Jesstess
(Created page with '==Numbers: integers and floats== ====Addition==== <pre> >>> 2 + 2 4 </pre> ====Subtraction==== <pre> >>> 0 - 2 -2 </pre> ====Multiplication==== <pre> >>> 2 * 3 6 </pre> ==…')
 
imported>Jesstess
No edit summary
Line 56:
>>> type(1.0)
<type 'float'>
</pre>
 
==Strings==
 
<pre>
>>> "Hello"
'Hello'
</pre>
 
====Printing strings====
 
<pre>
>>> print "Hello"
Hello
</pre>
 
====String concatenation====
 
<pre>
>>> print "Hello" + "World"
HelloWorld
>>> print "Hello", "World"
Hello World
>>> print "Hello", "World", 1
Hello World 1
</pre>
 
====Types====
 
<pre>
>>> type("Hello")
<type 'str'>
</pre>
Anonymous user