# this is a comment and will not run in the code

'''this is just a mulit line comment'''

pwd

#addition
2+1

# substraction
2-1

1-2

2*2

3/2

3.0/2

float(3)/2

3/float(2)

from __future__ import division
3/2

1/2

2/3

root(2)

sqrt(2)

4^2

4^.5

4**.5

a=5

a=6
a+a

a

0.1+0.2-0.3

'hello'

'this entire thing can be a string'

"this is using double quotes"

print 'hello'

print("hello")

s='hello'

s

len(s)

print(s)

s[3]

s[10]

s[5]

s[2:4]

z*10

letter='z'
letter*10

letter.upper()

letter.center('z')

print 'this is a string'

"""
Explanation: markdown test, i can write normal text here and it will not run as code!
End of explanation
"""


s = 'STRING'
print 'place another string with a mod and s: %s' %(s)

from __future__ import print_function

print('hello')

print('one: {x}'.format(x='INSERT'))

my_list = [1,2,3,'o','29a jeoilapif a']

len(my_list)

my_list[1:]

my_list[1]+1

my_list[1] = 5

my_list

my_list + ['just a simple test'
]

my_list * 2

l = [1,2,3]

l.append('append me')

l

l.pop(2)

l

l.pop()

l

l[100]

new_list = ['a','b','x','f','c']

new_list

new_list.reverse()

new_list.reverse()

new_list

lst_1 = [1,2,3]
lst_2 = [4,5,6]
lst_3 = [7,8,9]
matrix = [lst_1, lst_2, lst_3]

matrix

matrix[2][1]

first_col = [row[0] for row in matrix]

first_col

my_dict = {'key1':'this is cool','key2':2, 'key3':'duh','key4':['a','b',3]}

my_dict['key4']

my_dict.pop('key3')

my_dict

my_dict['key4'][1].upper()

my_dict['key2'] -= 5

my_dict

d = {}

d['animal'] = 'dog'

d

d['answer']=421

d

d.pop('anwer')

d

d = {'key 1':{'nestkey':{'subnestkey':'value'}}}

d

d['key 1']['nestkey']['subnestkey']

d = {'key1':1,'key2':2,'key3':3}

d.keys()

d.values()

d.items()

t = (1,2,3)

len(t)

t = ('one',2,'cool dude')

t

t[1
]

t[-1]

t.index('one
        ')

t.index('one')

t.count('one')

t[0] = 'change'

t.append('nope')

pwd

f = open('text_file.txt')

f.read()

f.seek(0)

f.read()

f.read()

f.readlines()

f.seek()

f.seek(0)

f.readlines()

%%writefile new.txt
first line
second line

for line in open('new.txt'):
    print('line')

"""
Explanation: strings yoiu can use the %s to format strings into your print statements
End of explanation
"""


