Main.Types History

Hide minor edits - Show changes to markup

January 21, 2010, at 01:36 PM MST by 129.82.44.241 -
Added lines 1-28:

(:source lang=python:)

"""Python types"""

  1. every object in python has a type:
  2. an integer is of type 'int'

print type(17)

  1. "hello" is a string:

print type("hello")

  1. floating point numbers are of type 'float':

print type(3.2)

  1. although it can be interpreted as a number "17" is a string:

print type("17")

  1. Double quoted strings can contain single quotes in them:

print "Bruce's beard"

  1. single quoted strings can have double quotes in them:

print 'The knights who say "Ni!"'

(:sourceend:)