In [1]:
print 'Hello World'
In [1]:
In [3]:
4 * 4
Out[3]:
In [4]:
x = 'infinity'
In [5]:
print x
In [6]:
x * 3
Out[6]:
In [7]:
newlist = []
In [15]:
newlist
Out[15]:
In [16]:
alex = 'elementary'
In [17]:
alex * 4
Out[17]:
In [20]:
newlist.insert
Out[20]:
In [21]:
listclasses=['French', 'Calculus', 'Classics', 'Physics', 'Chemistry']
In [22]:
print listclasses
In [26]:
listclasses[1]
Out[26]:
In [27]:
listsongs=['While the world let go', 'Ever enough', 'Forever unstoppable']
In [28]:
listclasses+listsongs
Out[28]:
In [32]:
title = 'her highness'
In [33]:
names =['Alex', 'Stephanie', 'Grace']
In [40]:
title + names [1], title+names [0], title+names [2]
Out[40]:
In [44]:
for i in names:
print i
In [47]:
for f in range(3):
print f
In [49]:
print 'technology'
In [63]:
x = 'infinity'
In [64]:
for i in range(3):
print i
In [65]:
x = 'infinity'
In [66]:
print x
In [69]:
print x+In[33]
In [75]:
import random
In [76]:
random.randint(40, 250)
Out[76]:
In [77]:
random.randint(12, 45)*4
Out[77]:
In [82]:
x = 'do you know what you are doing? '
In [79]:
names=['mum', 'harold', 'chris']
In [80]:
for i in names:
print i
In [86]:
for i in names:
print x+i
In [90]:
colour=['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
In [91]:
print colour
In [94]:
for s in colour:
print s
In [100]:
x = 'awash in '
In [98]:
for s in colour:
print s
In [101]:
print x
In [102]:
for s in colour:
print x+s
In [109]:
y = 'but not '
In [110]:
for s in colour:
print y+x+s
In [117]:
for s in colour:
print y.title()+x+s
In [119]:
for s in colour:
print y+x+s.upper()
In [127]:
In [122]:
In [ ]: