Python Code
Python Code
Python Code
def run():
gen = gen_dict(10)
values = list(gen.values())
values = sorted(values, key=lambda n: n)
print(values)
gen_fixed = {k: v*100 for k, v in gen.items()}
print(gen_fixed)
l = []
l.append(1)
l.extend([2, 3])
n = 2
if n != 4:
print("")
if n != 4:
print("e")
d = {}
d2 = {'miu': 4, 'leo': 34, 'aad': 45}
for i, v in d2.items():
print(v)
d['dd'] = 1
def gen_dict(records_num):
return {i: randint(0, 1000) for i in range(records_num)
class Car:
def __init__(self, speed):
self.speed = speed
class SuperCar(Car):
def __init__(self, speed, accel):
self.speed = speed
self.accel = accel