mathsoftware

A course about LaTeX and SageMath
git clone https://git.tronto.net/mathsoftware
Download | Log | Files | Refs | README | LICENSE

live_interactive.py (1875B)


      1 2+2
      2 3*5
      3 3/5
      4 3 // 5
      5 2.5 + (456 - 0.3)
      6 2 ** 10
      7 13 // 5
      8 13 % 5
      9 sqrt(3)
     10 import math
     11 sqrt(3)
     12 math.sqrt(3)
     13 help()
     14 math
     15 asfdads
     16 2+2
     17 help("import")
     18 sqrt(10)
     19 math.sqrt(10)
     20 from math import *
     21 sqrt(10)
     22 10 - _
     23 _
     24 x = 10 + sqrt(3)
     25 x
     26 abc_3 = 45+3*(2-1.4)
     27 abc_3
     28 x / (abc_3+2)
     29 x
     30 x = 3*abc_3
     31 x
     32 abc_3 = 0
     33 abc_3
     34 x
     35 1 = 1
     36 1 == 1
     37 1 == 3
     38 x
     39 type(x)
     40 abc_3
     41 type(abc_3)
     42 type(3/2)
     43 type(3/1)
     44 3/1
     45 type(1 == 1)
     46 y = False
     47 z = (2 == 2)
     48 y
     49 z
     50 type(z)
     51 type(y)
     52 y and z
     53 True and True
     54 y or z
     55 not True
     56 3 >= 4
     57 3 >= 3
     58 3 > 3
     59 3 != 4
     60 hello
     61 "hello"
     62 type("hello")
     63 st = "Hello, World!"
     64 st
     65 type(st)
     66 len(st)
     67 "hello" + ", world"
     68 "abc" + "abc"
     69 2 * "abc"
     70 10 * "abc"
     71 "hello" * "abc"
     72 True + False
     73 [1,2,3,1,-1.5]
     74 [1,True,"hello"]
     75 L = [1,True,"hello"]
     76 type(L)
     77 {1,2,3,1,-1.5}
     78 {12, 25, 10, -1}
     79 len(L)
     80 len({1,1,1})
     81 {1,1,1}
     82 1 in L
     83 -42 in L
     84 1.5 in {2,3.1,1.5}
     85 S = {-2, 0, 10, 25}
     86 max(S)
     87 min(S)
     88 sum(S)
     89 sum([10,2,45])
     90 L
     91 min(L)
     92 L2 = [1,2, 1, -2, 0, 2]
     93 set(L2)
     94 list({1,2,1,3,-2})
     95 S
     96 list(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}]
    106 range(0,4)
    107 type(range(0,4))
    108 [i*j for i in range(0,4) for j in {-1,1}]
    109 list(range(0,4))
    110 list(range(3,4))
    111 list(range(3,10))
    112 list(range(10))
    113 list(range(1,10,2))
    114 list(range(10,1,-1))
    115 L
    116 L[0]
    117 L[1]
    118 L[2]
    119 L[10]
    120 L[-1]
    121 L[len(L)-1]
    122 L[len(L)-3]
    123 L[-3]
    124 L2
    125 L[1:4]
    126 L2[1:4]
    127 L2[1:4:2]
    128 R=range(10)
    129 R
    130 R=list(range(10))
    131 R
    132 R[2:8:2]
    133 R[9:3:-1]
    134 R
    135 type(R)
    136 R[3]
    137 R[3] = 3.14
    138 R
    139 R.append(10)
    140 R
    141 R.insert(3,3.0)
    142 R
    143 R[3]
    144 del R[4]
    145 R
    146 L
    147 R
    148 L + R
    149 L
    150 R
    151 L * 3
    152 3 * L
    153 S
    154 type(S)
    155 S.add(3)
    156 S
    157 S.add(10)
    158 S
    159 S.remove(25)
    160 S
    161 T = {3, -2, 27, 99}
    162 {3, -2} < T
    163 {3, -2} < S
    164 S >= {3, -2}
    165 S >= S
    166 S > S
    167 S | T
    168 S & T
    169 S - T
    170 2+3
    171 import readline
    172 readline.write_history_file('live_interactive.py')