Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.2.1
>>> print(x)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
print(x)
^
NameError: name 'x' is not defined
>>> for x in 'ahoj':
... print(x)
a
h
o
j
>>> print(x)
j
>>> import random
>>> random.random()
0: 0.9372358963448458
>>> random.random()
1: 0.7477187691164399
>>> random.random()
2: 0.2288196343234814
>>> random.random()
3: 0.10582582837769616
>>> random.seed(1)
>>> random.random()
4: 0.13436424411240122
>>> random.random()
5: 0.8474337369372327
>>> random.random()
6: 0.763774618976614
>>> random.seed(1)
>>> random.random()
7: 0.13436424411240122
>>> random.random()
8: 0.8474337369372327
>>> random.random()
9: 0.763774618976614
>>> 2**19937 - 1
C:\Program Files (x86)\DreamPie\data\subp-py3\dreampielib\subprocess\__init__.py:391: UserWarning: pprint raised an exception, using repr instead. To reproduce, run: "from pprint import pprint; pprint(_)"
warn('pprint raised an exception, using repr instead. '
Traceback (most recent call last):
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 62, in pformat
underscore_numbers=underscore_numbers).pformat(object)
^^^^^^^^^^^^^^^
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 158, in pformat
self._format(object, sio, 0, 0, {}, 0)
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 175, in _format
rep = self._repr(object, context, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 455, in _repr
repr, readable, recursive = self.format(object, context.copy(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 468, in format
return self._safe_repr(object, context, maxlevels, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\znamenaj\Python311\Lib\pprint.py", line 563, in _safe_repr
return repr(object), True, False
^^^^^^^^^^^^
ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\DreamPie\data\subp-py3\dreampielib\subprocess\__init__.py", line 439, in execute
res_str = self.safe_pformat(self.last_res)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files (x86)\DreamPie\data\subp-py3\dreampielib\subprocess\__init__.py", line 393, in safe_pformat
return str(repr(obj))
^^^^^^^^^
ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
[About 31 more lines. Double-click to unfold]
>>> xs = list(range(10))
>>> xs
10: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> xs = random.shuffle(xs)
>>> xs
>>> xs = list(range(10))
>>> xs
11: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> random.shuffle(xs)
>>> xs
12: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> ys = random.shuffle(xs)
>>> xs
13: [1, 9, 0, 8, 6, 3, 2, 4, 5, 7]
>>> ys
>>> print(ys)
None
>>> xs = [2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> len(xs)
14: 10
>>> xs[0]
15: 2
>>> xs[-1]
16: 7
>>> xs[5]
17: 4
>>> xs[5:]
18: [4, 3, 6, 0, 7]
>>> xs[:5]
19: [2, 5, 1, 9, 8]
>>> xs[::3]
20: [2, 9, 3, 7]
>>> xs[::-1]
21: [7, 0, 6, 3, 4, 8, 9, 1, 5, 2]
>>> xs.append(666)
>>> xs
22: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666]
>>> xs.pop()
23: 666
>>> xs
24: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> xs.insert(0, 666)
>>> xs
25: [666, 2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> xs.pop(0)
26: 666
>>> xs
27: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> 6 in xs
28: True
>>> xs.index(6)
29: 7
>>> xs[7]
30: 6
>>> xs.count(0)
31: 1
>>> xs.append(666)
>>> xs
32: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666]
>>> xs.extend(666)
Traceback (most recent call last):
File "<pyshell#52>", line 1, in <module>
xs.extend(666)
TypeError: 'int' object is not iterable
>>> xs.extend([666])
>>> xs
33: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666, 666]
>>> xs.append([666, 333])
>>> xs
34: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666, 666, [666, 333]]
>>> xs.extend([666, 333])
>>> xs
35: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666, 666, [666, 333], 666, 333]
>>> xs += [666, 333]
>>> xs
36: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 666, 666, [666, 333], 666, 333, 666, 333]
>>> xs.extend(('a', 'b'))
>>> xs
37: [2,
5,
1,
9,
8,
4,
3,
6,
0,
7,
666,
666,
[666, 333],
666,
333,
666,
333,
'a',
'b']
>>> xs += ('a', 'b')
>>> xs
38: [2,
5,
1,
9,
8,
4,
3,
6,
0,
7,
666,
666,
[666, 333],
666,
333,
666,
333,
'a',
'b',
'a',
'b']
>>> xs[10:]
39: [666, 666, [666, 333], 666, 333, 666, 333, 'a', 'b', 'a', 'b']
>>> xs[9:]
40: [7, 666, 666, [666, 333], 666, 333, 666, 333, 'a', 'b', 'a', 'b']
>>> del xs[10:]
>>> xs
41: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7]
>>> xs = xs + ['a', 'b']
>>> xs
42: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b']
>>> xs = xs + ('a', 'b')
Traceback (most recent call last):
File "<pyshell#71>", line 1, in <module>
xs = xs + ('a', 'b')
~~~^~~~~~~~~~~~
TypeError: can only concatenate list (not "tuple") to list
>>> xs
43: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b']
>>> id(xs)
44: 1867623505792
>>> xs += [666, 333]
>>> xs
45: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 666, 333]
>>> id(xs)
46: 1867623505792
>>> xs = xs + [111]
>>> xs
47: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 666, 333, 111]
>>> id(xs)
48: 1867623510080
>>> xs
49: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 666, 333, 111]
>>> xs += [666, 333]
>>> xs
50: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 666, 333, 111, 666, 333]
>>> xs.remove(666)
>>> xs
51: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 333, 111, 666, 333]
>>> xs.remove(666)
>>> xs
52: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 333, 111, 333]
>>> xs.remove(666)
Traceback (most recent call last):
File "<pyshell#87>", line 1, in <module>
xs.remove(666)
ValueError: list.remove(x): x not in list
>>> xs
53: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 333, 111, 333]
>>> xs.reverse()
>>> xs
54: [333, 111, 333, 'b', 'a', 7, 0, 6, 3, 4, 8, 9, 1, 5, 2]
>>> xs.reverse()
>>> xs
55: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 'a', 'b', 333, 111, 333]
>>> xs.index('a')
56: 10
>>> xs[10:11]
57: ['a']
>>> xs[10:12]
58: ['a', 'b']
>>> del xs[10:12]
>>> xs
59: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> xs.sort()
>>> xs
60: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 111, 333, 333]
>>> xs = [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> xs
61: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> sorted(xs)
62: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 111, 333, 333]
>>> xs
63: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> [x for x in xs if x % 2 == 0]
64: [2, 8, 4, 6, 0]
>>> ys = []
... for x in xs:
... if x % 2 == 0:
... ys.append(x)
>>> ys
65: [2, 8, 4, 6, 0]
>>> [x for x in xs]
66: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> xs
67: [2, 5, 1, 9, 8, 4, 3, 6, 0, 7, 333, 111, 333]
>>> ys = [x for x in xs]
>>> id(xs)
68: 1867623362240
>>> id(ys)
69: 1867623363840
>>> ys = [x**2 for x in xs]
>>> [x**2 for x in xs]
70: [4, 25, 1, 81, 64, 16, 9, 36, 0, 49, 110889, 12321, 110889]
>>> [x**2 for x in xs if x % 2 == 0]
71: [4, 64, 16, 36, 0]
>>> [x*3 for x in 'ahoj']
72: ['aaa', 'hhh', 'ooo', 'jjj']
>>> [1 for x in 'ahoj']
73: [1, 1, 1, 1]
>>> ['ahoj' for x in 'ahoj']
74: ['ahoj', 'ahoj', 'ahoj', 'ahoj']
>>> [(x, y) for x in (1, 2, 3) for y in 'ab']
75: [(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b'), (3, 'a'), (3, 'b')]
>>> [(x, y)
... for x in (1, 2, 3)
... for y in 'ab'
... ]
76: [(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b'), (3, 'a'), (3, 'b')]
>>> '''
... [x, y
... for x in (1, 2, 3)
... for y in 'ab'
... ]
... '''
77: "\n[x, y\n for x in (1, 2, 3)\n for y in 'ab'\n]\n"
>>> [(x, y)
... for x in (1, 2, 3)
... for y in 'ab'
... if x == 2
... ]
78: [(2, 'a'), (2, 'b')]
>>> [(x, y)
... for x in (1, 2, 3)
... for y in 'ab'
... if x == 2
... if y == 'b'
... ]
79: [(2, 'b')]
>>> [(x, y)
... for x in (1, 2, 3)
... if x == 2
... for y in 'ab'
... if y == 'b'
... ]
80: [(2, 'b')]
>>> [(x, y)
... for x in (1, 2, 3)
... if y == 'b'
... for y in 'ab'
... if x == 2
... ]
Traceback (most recent call last):
File "<pyshell#124>", line 1, in <module>
[(x, y)
File "<pyshell#124>", line 3, in <listcomp>
if y == 'b'
^
UnboundLocalError: cannot access local variable 'y' where it is not associated with a value
>>> x
81: 333
>>> y
Traceback (most recent call last):
File "<pyshell#126>", line 1, in <module>
y
NameError: name 'y' is not defined
>>> z = 'abc'
>>> [x for x in z]
82: ['a', 'b', 'c']
>>> x
83: 333
>>> xs = [
... [1, 2, 3],
... [4, 5, 6],
... [7, 8, 9],
... ]
>>> len(xs)
84: 3
>>> xs[0]
85: [1, 2, 3]
>>> xs[0][-1]
86: 3
>>> xs[0, -1]
Traceback (most recent call last):
File "<pyshell#134>", line 1, in <module>
xs[0, -1]
~~^^^^^^^
TypeError: list indices must be integers or slices, not tuple
>>>