In [2]:
print 'Hello world!'
In [5]:
i = 10
print type(i)
f = 4.1
print type(f)
In [8]:
print 'Our float number is %f. Our integer number is %d.' % (f, i)
In [11]:
if i == 10 and f > 4.0:
print 'Lala!'
else:
print 'Haha!'
In [12]:
l = [3, 1, 2]
In [13]:
for element in l:
print element
In [17]:
counter = 6
while counter < 10:
print counter
counter += 1
In [20]:
def add2(x):
y = x + 2
return y
i = 5
add2(i)
Out[20]:
In [22]:
# Lambda functions
square = lambda x: x**2
square(3)
Out[22]: