2
10
10 + 20
(10 + 20) * 4
2 ** 8
10 / 2
type(10)
type(5.0)
"42"
"42" == 42
42.0 == 42
"hello " + "world" == "hello world"
"hello".upper()
"hello"[0]
"hello"[1]
"hello"[-1]
"hello"[-2]
[1, 2, 3]
[1, 2, 3] + [4,5,6]
[1, 2, 3, 4, 5, 6].index(6)
[1, 2, 3, 4, 5, 6][5]
x = [1, 2, 3, 4, 5, 6]
type([1, 2, 3, 4, 5, 6])
type(x)
x
x[0]
len(x)
x[5]
x.index(6)
x[-1]
x[-2]
x[-3]
y= [1,1,1,1,1,1,1,1,1,1]
y[0]
y.index(1)
y.index(2)
"h" in "hello"
"ell" in "hello"
"ell" in "world"
10 in [1,2,3]
[1,2,3, "hello", [5.0], [[[[0]]]]]
z = [1,2,3, "hello", [5.0], [[[[0]]]]]
z[-1][-1][0][0][-1]
[1,2,3, "hello", [5.0], [[[[0]]]]] + x
z
z[0]= x
z
x
y
z
d = {
"x" : x,
"y" : y,
"z" : z,
"greeting" : "live and long and prosper",
1 : "one",
2 : "two"
}
d["x"]
d["greeting"]
d[2]
d[0]
list(d.items())[0]
int("42") + 8
"42" + str(8)
list("hello")
cities = {
"isreal" : "jerusalem",
"uk" : "london",
"france" : "paris"
}
cities
cities["germany"] = "berlin"
cities
cities["switzerland"] = "zurich"
cities["switzerland"] = "bern"
cities
cities.items()
['isreal', 'jerusalem']
('isreal', 'jerusalem')
t = ('isreal', 'jerusalem')
x
x.append(7)
x
t[0]
t[1]
country = t[0]
city = t[1]
country
city
country, city = t
country
type([])
type(t)
type(cities)
help("hello".find)
help(type)
type(str)
help(str)
len(x)
x
import math
math.cos(0)
math.pi
print
myprint = print
help(myprint)
print = 10
myprint(print)
print = myprint
print(print)
list = [1,2,3]
tuple("hello")
list("hello")
list
list_ = list
type([])
list = type([])
list("hello")
math
kongfu = math
kongfu
kongfu.pi
help(kongfu)