Cerca

Heus ací els resultats de la cerca.

2.6 Abstract classes
19 Resultats, Darrera modificació:
tiated: <code python> class BluePrint: def hello(self): print('Nothing is blue unless you need it') bp = BluePrint() bp.hello() </code> There’s nothing new for you here – it’s... rint(abc.ABC): @abc.abstractmethod def hello(self): pass class GreenField(BluePrint): def hello(self): print('Welcome to Green Field!')
2.4 Decorators
16 Resultats, Darrera modificació:
heory. So, let's create a function – ''simple_hello()'' is one of the simplest functions we could thi... rate it in a moment. <code python> def simple_hello(): print("Hello from simple function!") </code> <code python> def simple_decorator(function): ... de python> decorated = simple_decorator(simple_hello) decorated() </code> The whole code should look l
4.1 Shallow and deep copy operations
2 Resultats, Darrera modificació:
elf.properties = ["112", "997"] print("Hello from __init__()") a_example = Example() b_exampl... t to get the following output: <code ; output> Hello from __init__() Memory chunks: 140319166493840 14
4.2 Serialization of Python objects using the pickle module
1 Resultats, Darrera modificació:
de python> import pickle def f1(): print('Hello from the jar!') with open('function.pckl', 'wb')