23 KiB
23 KiB
In [ ]:
i = 1
j = 219089
k = -21231In [ ]:
print(i, j, k)In [ ]:
a = 4.3
b = -5.2111222
c = 3.1e33In [ ]:
print(a, b, c)In [ ]:
d = complex(4., -1.)In [ ]:
print(d)In [ ]:
1 + 3In [ ]:
3. * 2.In [ ]:
complex(2., 4.) - complex(1., 6.)In [ ]:
3 * 9.2In [ ]:
2. * complex(-1., 3.)In [ ]:
8 * complex(-3.3, 1)In [ ]:
3 / 2In [ ]:
3 // 2In [ ]:
# enter your solution hereIn [ ]:
s = "roof tile roof roof"In [ ]:
"I'm"In [ ]:
'"hello"'In [ ]:
'I\'m'In [ ]:
"\"hello\""In [ ]:
s = "roof tile roof roof"
s[5]In [ ]:
s[0]In [ ]:
s[5] = 'r'In [ ]:
len(s)In [ ]:
"hello," + " " + "world!"In [ ]:
s.upper() # An uppercase version of the stringIn [ ]:
s.index('tile') # An integer giving the position of the sub-stringIn [ ]:
s.split() # A list of stringsIn [ ]:
li = [4, 5.5, "roof"]In [ ]:
li[0]In [ ]:
li[1]In [ ]:
li[2]In [ ]:
li[1] = -2.2In [ ]:
liIn [ ]:
li.append(-3)In [ ]:
liIn [ ]:
li.insert(1, 2.718)In [ ]:
liIn [ ]:
len([1,2,3,4,5])In [ ]:
li = [4, 67, 4, 2, 4, 6]In [ ]:
li[-1]In [ ]:
li[0:2]In [ ]:
li[:2] # ``start`` defaults to zeroIn [ ]:
li[2:] # ``end`` defaults to the last element In [ ]:
li[::2] # specify a step sizeIn [ ]:
a = "Hello, roof world!"
# enter your solution here
In [ ]:
l=[3,4,5]
l.In [ ]:
s = "CAGTACCAAGTGAAAGAT"
# your solution here
In [ ]:
a = [1, 2, 3]
b = [4, 5, 6]
# your solution here
In [ ]:
a = 1
type(a)In [ ]:
a = 2.3
type(a)Warning:
Output truncated. This notebook contains too many cells to display efficiently.