print 'Hello World!'

"""
Explanation: Installing Python and GraphLab Create
Please follow the installation instructions here before getting started:
We have done

Installed Python
Started Ipython Notebook

Getting started with Python
End of explanation
"""


i = 4  #int

type(i)

f = 4.1  #float

type(f)

b = True  #boolean variable

s = "This is a string!"

print s

"""
Explanation: Create some variables in Python
End of explanation
"""


l = [3,1,2]  #list

print l

d = {'foo':1, 'bar':2.3, 's':'my first dictionary'}  #dictionary

print d

print d['foo']  #element of a dictionary

n = None  #Python's null type

type(n)

"""
Explanation: Advanced python types
End of explanation
"""


print "Our float value is %s. Our int value is %s." % (f,i)  #Python is pretty good with strings

"""
Explanation: Advanced printing
End of explanation
"""


if i == 1 and f > 4:
    print "The value of i is 1 and f is greater than 4."
elif i > 4 or f > 4:
    print "i or f are both greater than 4."
else:
    print "both i and f are less than or equal to 4"


"""
Explanation: Conditional statements in python
End of explanation
"""


print l

for e in l:
    print e

"""
Explanation: Conditional loops
End of explanation
"""


counter = 6
while counter < 10:
    print counter
    counter += 1

"""
Explanation: Note that in Python, we don't use {} or other markers to indicate the part of the loop that gets iterated.  Instead, we just indent and align each of the iterated statements with spaces or tabs. (You can use as many as you want, as long as the lines are aligned.)
End of explanation
"""


def add2(x):
    y = x + 2
    return y

i = 6

add2(i)

"""
Explanation: Creating functions in Python
Again, we don't use {}, but just indent the lines that are part of the function.
End of explanation
"""


square = lambda x: x*x

square(5)




"""
Explanation: We can also define simple functions with lambdas:
End of explanation
"""


