note from william. oh no. seems you forgot to save! Remember to click File -> save. Partly my own fault for not showing people/doing it myself for you at the end of the session.


In [1]:
print 'hello world'


hello world

In [2]:
5 * 5


Out[2]:
25

In [3]:
print "I still want to learn how to python my way through life"


I still want to learn how to python my way through life

In [3]:
10 - 5


Out[3]:
5

In [5]:
print "Goodbye world!"


Goodbye world!

In [6]:
print "I still want to learn how to use this wriggly format of writing and getting it written"


I still want to learn how to use this wriggly format of writing and getting it written

In [9]:
x = 'what a way to go!'

In [10]:


In [11]:
x * 25


Out[11]:
'what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!what a way to go!'

In [12]:
5 * 5


Out[12]:
25

In [13]:
4 - 20


Out[13]:
-16

In [14]:
y = 50

In [15]:
y * 20


Out[15]:
1000

In [16]:
'Well, I forgot to save my statting lesson - so I had better save my progress this time'


Out[16]:
'Well, I forgot to save my statting lesson - so I had better save my progress this time'

In [17]:
y = 10

In [18]:
'hullo there beautiful'


Out[18]:
'hullo there beautiful'

In [19]:
getinput('testing!')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-19-b2649f09796d> in <module>()
----> 1 getinput('testing!')

NameError: name 'getinput' is not defined

In [20]:
def getinput(stringname):
    mylist.append(stringname)
    return stringname

In [22]:
getinput('hullo there gorgeous!')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-22-9808fbf86081> in <module>()
----> 1 getinput('hullo there gorgeous!')

<ipython-input-20-fa1d988eaaa1> in getinput(stringname)
      1 def getinput(stringname):
----> 2     mylist.append(stringname)
      3     return stringname

NameError: global name 'mylist' is not defined

In [23]:
mylist = []

In [24]:
def getinput(stringname):
    mylist.append(stringname)
    return stringname

In [26]:
getinput('hullo there!')


Out[26]:
'hullo there!'

In [30]:
print mylist


['hullo there!', 'anything will do']

In [28]:
mylist.append(memory)my


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-28-8434369e9665> in <module>()
----> 1 mylist.append(memory)

NameError: name 'memory' is not defined

In [29]:
mylist.append('anything will do')

In [31]:
mylist[0]


Out[31]:
'hullo there!'

In [32]:
mylist.sort()

In [39]:
import random

In [34]:
mylist.remove('hullo there!')

In [46]:
random.randint(2,10)


Out[46]:
8

In [17]:
random.randint(1,8)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-17-ae13e578d8b7> in <module>()
----> 1 random.randint(1,8)

NameError: name 'random' is not defined

In [55]:
x = random.randint(2,10)

In [58]:
print x


2

In [16]:
x = random.randint(4,9)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-c1b8f48f6e19> in <module>()
----> 1 x = random.randint(4,9)

NameError: name 'random' is not defined

In [15]:
x = random.randint(2,10)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-15-0579cc5b0898> in <module>()
----> 1 x = random.randint(2,10)

NameError: name 'random' is not defined

In [14]:
print x


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-14-2d264e11d975> in <module>()
----> 1 print x

NameError: name 'x' is not defined

In [12]:
x = random.randint(12,16)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-12-95cdcf15c78f> in <module>()
----> 1 x = random.randint(12,16)

NameError: name 'random' is not defined

In [11]:
import random


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-11-2d264e11d975> in <module>()
----> 1 print x

NameError: name 'x' is not defined