'_14',

'_15',

'_16',

'_17',

'_19',

'_2',

'_20',

'_21',

'_23',

'_24',

'_25',

'_26',

'_27',

'_29',

'_30',

'_31',

'_32',

'_4',

'_46',

'_47',

'_48',

'_57',

'_58',

'_6',

'_61',

'_71',

'_74',

'_8',

'__',

'___',

'__builtin__',

'__builtins__',

'__doc__',

'__loader__',

'__name__',

'__package__',

'__spec__',

'_dh',

'_i',

'_i1',

'_i10',

'_i11',

'_i12',

'_i13',

'_i14',

'_i15',

'_i16',

'_i17',

'_i18',

'_i19',

'_i2',

'_i20',

'_i21',

'_i22',

'_i23',

'_i24',

'_i25',

'_i26',

'_i27',

'_i28',

'_i29',

'_i3',

'_i30',

'_i31',

'_i32',

'_i33',

'_i34',

'_i35',

'_i36',

'_i37',

'_i38',

'_i39',

'_i4',

'_i40',

'_i41',

'_i42',

'_i43',

'_i44',

'_i45',

'_i46',

'_i47',

'_i48',

'_i49',

'_i5',

'_i50',

'_i51',

'_i52',

'_i53',

'_i54',

'_i55',

'_i56',

'_i57',

'_i58',

'_i59',

'_i6',

'_i60',

'_i61',

'_i62',

'_i63',

'_i64',

'_i65',

'_i66',

'_i67',

'_i68',

'_i69',

'_i7',

'_i70',

'_i71',

'_i72',

'_i73',

'_i74',

'_i75',

'_i8',

'_i9',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'a',

'b',

'c',

'countstr',

'd',

'e',

'exit',

'get_ipython',

'quit',

'x']


In [76]: long = 10


In [77]: long

Out[77]: 10


In [78]: a = countstr("Tuesday is hard day")

string is long and has 19 characters


In [79]: long 10

File "<ipython-input-79-cc8d3f321724>", line 1

long 10

^

SyntaxError: invalid syntax



In [80]: long

Out[80]: 10


In [81]: long 20

File "<ipython-input-81-f7a8efce7775>", line 1

long 20

^

SyntaxError: invalid syntax



In [82]: long = 20


In [83]: a = countstr("Tuesday is hard day")

string is long and has 19 characters


In [84]: long

Out[84]: 20


In [85]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters


In [86]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters

13 is smaller than 20

I am still inside the else


In [87]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters

13 is smaller than 20

I am still inside the else

string is long and has 24 characters


In [88]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters

13 is smaller than 20

I am still inside the else

string is long and has 24 characters


In [89]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

File "//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py", line 9

if x > a:

^

IndentationError: unexpected indent



In [90]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters

13 is smaller than 20

I am still inside the else

string is long and has 24 characters


In [91]: runfile('//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2/Lecture2.py', wdir='//filestore.soton.ac.uk/users/oh1m12/mydocuments/20172018/Lecture2')

**

I am outside of the if-else

Thank you

string is long and has 19 characters

13 is smaller than 20

I am still inside the else

string is long and has 24 characters


In [92]: a = 5


In [93]: a**(1/2)

Out[93]: 2.23606797749979


In [94]: import math


In [95]: dir(math)

Out[95]:

['__doc__',

'__loader__',

'__name__',

'__package__',

'__spec__',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'ceil',

'copysign',

'cos',

'cosh',

'degrees',

'e',

'erf',

'erfc',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'modf',

'nan',

'pi',

'pow',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc']


In [96]: a

Out[96]: 5


In [97]: math.sqrt(a)

Out[97]: 2.23606797749979


In [98]: a**(1/2)

Out[98]: 2.23606797749979


In [99]: math.cos(a)

Out[99]: 0.28366218546322625


In [100]: %reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y


In [101]: dir()

Out[101]:

['In',

'Out',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i101',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'exit',

'get_ipython',

'quit']


In [102]: import math


In [103]: dir()

Out[103]:

['In',

'Out',

'_',

'_101',

'__',

'___',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i101',

'_i102',

'_i103',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'exit',

'get_ipython',

'math',

'quit']


In [104]: %reset


Once deleted, variables cannot be recovered. Proceed (y/[n])? y


In [105]: dir()

Out[105]:

['In',

'Out',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i105',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'exit',

'get_ipython',

'quit']


In [106]: a

Traceback (most recent call last):


File "<ipython-input-106-60b725f10c9c>", line 1, in <module>

a


NameError: name 'a' is not defined



In [107]: a = 5


In [108]: math.sqrt(a)

Traceback (most recent call last):


File "<ipython-input-108-c7d50051514f>", line 1, in <module>

math.sqrt(a)


NameError: name 'math' is not defined



In [109]: import math


In [110]: math.sqrt(a)

Out[110]: 2.23606797749979


In [111]: import math as m


In [112]: m.sqrt(a)

Out[112]: 2.23606797749979


In [113]: from math import *


In [114]: sqrt(a)

Out[114]: 2.23606797749979


In [115]: dir()

Out[115]:

['In',

'Out',

'_',

'_105',

'_110',

'_112',

'_114',

'__',

'___',

'__builtin__',

'__builtins__',

'__name__',

'_dh',

'_i',

'_i105',

'_i106',

'_i107',

'_i108',

'_i109',

'_i110',

'_i111',

'_i112',

'_i113',

'_i114',

'_i115',

'_ih',

'_ii',

'_iii',

'_oh',

'_sh',

'a',

'acos',

'acosh',

'asin',

'asinh',

'atan',

'atan2',

'atanh',

'ceil',

'copysign',

'cos',

'cosh',

'degrees',

'e',

'erf',

'erfc',

'exit',

'exp',

'expm1',

'fabs',

'factorial',

'floor',

'fmod',

'frexp',

'fsum',

'gamma',

'gcd',

'get_ipython',

'hypot',

'inf',

'isclose',

'isfinite',

'isinf',

'isnan',

'ldexp',

'lgamma',

'log',

'log10',

'log1p',

'log2',

'm',

'math',

'modf',

'nan',

'pi',

'pow',

'quit',

'radians',

'sin',

'sinh',

'sqrt',

'tan',

'tanh',

'trunc']


In [116]: from math import *


In [117]: import math


In [118]: import math as mymath


In [119]: from math import cos


In [120]: