Main.Types History
Hide minor edits - Show changes to markup
January 21, 2010, at 01:36 PM MST
by -
Added lines 1-28:
(:source lang=python:)
"""Python types"""
- every object in python has a type:
- an integer is of type 'int'
print type(17)
- "hello" is a string:
print type("hello")
- floating point numbers are of type 'float':
print type(3.2)
- although it can be interpreted as a number "17" is a string:
print type("17")
- Double quoted strings can contain single quotes in them:
print "Bruce's beard"
- single quoted strings can have double quotes in them:
print 'The knights who say "Ni!"'
(:sourceend:)
