aboutsummaryrefslogtreecommitdiff
path: root/src/Lecture4/live/live_interactive.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Lecture4/live/live_interactive.py172
1 files changed, 172 insertions, 0 deletions
diff --git a/src/Lecture4/live/live_interactive.py b/src/Lecture4/live/live_interactive.py
new file mode 100644
index 0000000..671cbad
--- /dev/null
+++ b/src/Lecture4/live/live_interactive.py
@@ -0,0 +1,172 @@
12+2
23*5
33/5
43 // 5
52.5 + (456 - 0.3)
62 ** 10
713 // 5
813 % 5
9sqrt(3)
10import math
11sqrt(3)
12math.sqrt(3)
13help()
14math
15asfdads
162+2
17help("import")
18sqrt(10)
19math.sqrt(10)
20from math import *
21sqrt(10)
2210 - _
23_
24x = 10 + sqrt(3)
25x
26abc_3 = 45+3*(2-1.4)
27abc_3
28x / (abc_3+2)
29x
30x = 3*abc_3
31x
32abc_3 = 0
33abc_3
34x
351 = 1
361 == 1
371 == 3
38x
39type(x)
40abc_3
41type(abc_3)
42type(3/2)
43type(3/1)
443/1
45type(1 == 1)
46y = False
47z = (2 == 2)
48y
49z
50type(z)
51type(y)
52y and z
53True and True
54y or z
55not True
563 >= 4
573 >= 3
583 > 3
593 != 4
60hello
61"hello"
62type("hello")
63st = "Hello, World!"
64st
65type(st)
66len(st)
67"hello" + ", world"
68"abc" + "abc"
692 * "abc"
7010 * "abc"
71"hello" * "abc"
72True + False
73[1,2,3,1,-1.5]
74[1,True,"hello"]
75L = [1,True,"hello"]
76type(L)
77{1,2,3,1,-1.5}
78{12, 25, 10, -1}
79len(L)
80len({1,1,1})
81{1,1,1}
821 in L
83-42 in L
841.5 in {2,3.1,1.5}
85S = {-2, 0, 10, 25}
86max(S)
87min(S)
88sum(S)
89sum([10,2,45])
90L
91min(L)
92L2 = [1,2, 1, -2, 0, 2]
93set(L2)
94list({1,2,1,3,-2})
95S
96list(S)
97[x**2 for x in [-1,4,1,0] if x < 3]
98{x**2 for x in [-1,4,1,0] if x < 3}
99{x+2 for x in [-1,4,1,0] if x < 3}
100{x+2 for x in {-1,4,1,0} if x < 3}
101[x+2 for x in {-1,4,1,0} if x < 3]
102[x+2 for x in {-1,4,1,0} if True]
103[x+2 for x in {-1,4,1,0}]
104[x+2 for x in {-1,4,1,0} if x+10-3.24 < x^2]
105[i*j for i in [0,1,2,3] for j in {-1,1}]
106range(0,4)
107type(range(0,4))
108[i*j for i in range(0,4) for j in {-1,1}]
109list(range(0,4))
110list(range(3,4))
111list(range(3,10))
112list(range(10))
113list(range(1,10,2))
114list(range(10,1,-1))
115L
116L[0]
117L[1]
118L[2]
119L[10]
120L[-1]
121L[len(L)-1]
122L[len(L)-3]
123L[-3]
124L2
125L[1:4]
126L2[1:4]
127L2[1:4:2]
128R=range(10)
129R
130R=list(range(10))
131R
132R[2:8:2]
133R[9:3:-1]
134R
135type(R)
136R[3]
137R[3] = 3.14
138R
139R.append(10)
140R
141R.insert(3,3.0)
142R
143R[3]
144del R[4]
145R
146L
147R
148L + R
149L
150R
151L * 3
1523 * L
153S
154type(S)
155S.add(3)
156S
157S.add(10)
158S
159S.remove(25)
160S
161T = {3, -2, 27, 99}
162{3, -2} < T
163{3, -2} < S
164S >= {3, -2}
165S >= S
166S > S
167S | T
168S & T
169S - T
1702+3
171import readline
172readline.write_history_file('live_interactive.py')

Generated with cgit - Back to sebastiano.tronto.net