Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
- 'Camaro', 'production_year': 1988, 'convertible': True}, {'id': 3, 'brand': 'Aston Martin', 'model': 'Ra... 300SL', 'production_year': 195 q7, 'convertible': True}] </code> Note the line starting with ''applicat... hevrolet | Camaro | 1988 | True | 3 | Aston Martin | Rapide ... ercedes Benz | 300SL | 1957 | True | </code> If you don't need all the
- 2.6 Abstract classes @info:cursos:pue:python-pcpp1:m1
- on = 300 self.printer_operation_history = True self.fax_machine = False def high(se... on = 600 self.printer_operation_history = True self.fax_machine = True def scan_document(self): print("El document ha est... on = 300 self.printer_operation_history = True self.fax_machine = False class MFD3(MFD,
- 4.1 Shallow and deep copy operations @info:cursos:pue:python-pcpp1:m1
- alues could be compared, and the result would be 'True'. Moreover, when you compare two variables referencing the same object, the result would be also 'True'. To check whether both operands refer to the sa... tity: 3687888 The result of the value comparison: True The result of the identity comparison: True a_string identity: 3689048 b_string identity: 9418632 The
- 2.4 Shaping the main window and conversing with the user @info:cursos:pue:python-pcpp1:m3
- -= 50 if size <= 100: grows = True window.geometry(str(size) + "x" + str(size)) size = 100 grows = True window = tk.Tk() window.geometry("100x100") windo... ues, not integer values. Their meaning is: * ''True'' – the user can change this dimension; * ''Fal... n** with a **question** mark in it; * returns ''True'' if the user’s response is //Yes// and ''False''
- 1.4 Talking to JSON in Python @info:cursos:pue:python-pcpp1:m4
- ? <code python> import json my_list = [1, 2.34, True, "False", None, ['a', 0]] print(json.dumps(my_lis... all! The code prints: <code ; output> [1, 2.34, True, "False", null, ["a", 0]] </code> We want to ask... ook: <code python> import json jstr = '[1, 2.34, true, "False", null, ["a", 0]]' my_list = json.loads(j... prints: <code ; output> <class 'list'> [1, 2.34, True, 'False', None, ['a', 0]] </code> We expect that
- 2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP @info:cursos:pue:python-pcpp1:m1
- may only have one superclass — this is not always true, but we'll discuss this issue more a bit later. ... __', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'con
- 2.5 Different faces of Python methods @info:cursos:pue:python-pcpp1:m1
- ): if len(iban) == 20: return True else: return False </code> ... ): if len(iban) == 20: return True else: return False account_... t) <= 40 and text.isalnum(): retorn = True return retorn try:
- 2.9 Inheriting properties from built-in classes @info:cursos:pue:python-pcpp1:m1
- Error("IBAN entered is invalid.") return True test_keys = ['GB72 HBZU 7006 7212 1253 01', 'FR... orrectly formulated account number; * returns a True value when the account number conforms to all IBA... Error("IBAN entered is invalid.") return True my_dict = IBANDict() keys = ['GB72 HBZU 7006 72
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- ("A" > "a") print(1.0 == 1) print("1" == 1) print(True == "1") print(True == 1) print(True == 1.0) print("1" + "1") print(1 + 1) print(1 + "1") </code> Do you know the result o
- 3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
- uality operators when comparing Boolean values to True or False. Again, use is or is not instead: <code ... my_boolean_value = 2 > 1 if my_boolean_value == True: print("A") else: print("B") </code> <co... my_boolean_value = 2 > 1 if my_boolean_value is True: print("A") else: print("B") </code> <cod
- 4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
- . is_autonomous: bool self-driving -> True, not self-driving -> False Methods: ... it__(self, vehicle_type, id_number, is_autonomous=True): """ Parameters: -------... omous: bool, optional self-driving -> True (default), not self-driving -> False """
- 1.3 JSON – our new friend @info:cursos:pue:python-pcpp1:m4
- specific identifiers (the literal name tokens): **true** and **false**: <code ruby> true false </code> Note: you have to **preserve the case of the literals*... 3.0857E16, electron: −1.6021766208E−19 friend: "JSON", off: true, on: false, set: null } </code>
- 2.1 Python core syntax @info:cursos:pue:python-pcpp1:m1
- __', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'con
- 3.1 Advanced techniques of creating and serving exceptions @info:cursos:pue:python-pcpp1:m1
- d: list index out of range Is it the same object: True </code> The ''except Exception'' clause is a wid... d: list index out of range Is it the same object: True </code> == Advanced exceptions - explicitly chai
- 5.1 Metaprogramming @info:cursos:pue:python-pcpp1:m1
- e argument: <code python> for element in (1, 'a', True): print(element, 'is', element.__class__, typ... '> <class 'int'> a is <class 'str'> <class 'str'> True is <class 'bool'> <class 'bool'> </code> When th