Wednesday, May 6, 2015

Python: Data Types

TYPEDESCRIPTIONEXAMPLE
TrueTrue boolean value.True or False == True
FalseFalse boolean value.False and True == False
NoneRepresents "nothing" or "no value".x = None
stringsStores textual information.x = "hello"
numbersStores integers.i = 100
floatsStores decimals.i = 10.389
listsStores a list of things.j = [1,2,3,4]
dictsStores a key=value mapping of things.e = {'x': 1, 'y': 2}

No comments: