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 >>> xs = [1, 2, 3, 4, 5] >>> xs.append(6) >>> xs 0: [1, 2, 3, 4, 5, 6] >>> xs.pop() 1: 6 >>> xs 2: [1, 2, 3, 4, 5] >>> xs.pop() 3: 5 >>> xs 4: [1, 2, 3, 4] >>> xs.append(5) >>> xs 5: [1, 2, 3, 4, 5] >>> xs.pop() 6: 5 >>> xs.pop(0) 7: 1 >>> xs 8: [2, 3, 4] >>> xs.pop(0) 9: 2 >>> xs 10: [3, 4] >>> xs.insert(2, 0) >>> xs 11: [3, 4, 0] >>> xs.pop() 12: 0 >>> xs.insert(0, 2) >>> xs 13: [2, 3, 4] >>> xs.insert(0, 1) >>> xs 14: [1, 2, 3, 4] >>> xs.pop() 15: 4 >>> xs 16: [1, 2, 3] >>> import random >>> dir(random) 17: ['BPF', 'LOG4', 'NV_MAGICCONST', 'RECIP_BPF', 'Random', 'SG_MAGICCONST', 'SystemRandom', 'TWOPI', '_ONE', '_Sequence', '_Set', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_accumulate', '_acos', '_bisect', '_ceil', '_cos', '_e', '_exp', '_floor', '_index', '_inst', '_isfinite', '_log', '_os', '_pi', '_random', '_repeat', '_sha512', '_sin', '_sqrt', '_test', '_test_generator', '_urandom', '_warn', 'betavariate', 'choice', 'choices', 'expovariate', 'gammavariate', 'gauss', 'getrandbits', 'getstate', 'lognormvariate', 'normalvariate', 'paretovariate', 'randbytes', 'randint', 'random', 'randrange', 'sample', 'seed', 'setstate', 'shuffle', 'triangular', 'uniform', 'vonmisesvariate', 'weibullvariate'] [About 65 more lines. Double-click to unfold] >>> random.choice( (1, 2, 3, 4, 5) ) 18: 5 >>> random.choice( (1, 2, 3, 4, 5) ) 19: 5 >>> random.choice( (1, 2, 3, 4, 5) ) 20: 5 >>> random.choice( [1, 2, 3, 4, 5] ) 21: 2 >>> random.choice( [1, 2, 3, 4, 5] ) 22: 4 >>> random.choice( [1, 2, 3, 4, 5] ) 23: 1 >>> random.choice( {1, 2, 3, 4, 5} ) Traceback (most recent call last): File "<pyshell#31>", line 1, in <module> random.choice( {1, 2, 3, 4, 5} ) File "C:\Users\znamenaj\Python311\Lib\random.py", line 371, in choice return seq[self._randbelow(len(seq))] ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'set' object is not subscriptable >>> xs = [1, 2, 3] >>> random.choice(xs) 24: 3 >>> random.choice(xs) 25: 2 >>> random.choice(xs) 26: 3 >>> xs = [1, 1, 2, 3] >>> random.choice(xs) 27: 3 >>> random.choice(xs) 28: 1 >>> random.choice(xs) 29: 1 >>> random.choice(xs) 30: 1 >>> random.choice(xs) 31: 1 >>> random.choice(xs) 32: 2 >>> random.choice(xs) 33: 1 >>> random.uniform(0.7, 1.2) 34: 0.742249083294295 >>> random.uniform(0.7, 1.2) 35: 1.155412677723842 >>> random.uniform(0.7, 1.2) 36: 0.8218352006503495 >>>