MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __init__

Method __init__

example_code/item_058.py:76–79  ·  view source on GitHub ↗
(self, ohms)

Source from the content-addressed store, hash-verified

74print("Example 4")
75class Resistor:
76 def __init__(self, ohms):
77 self.ohms = ohms
78 self.voltage = 0
79 self.current = 0
80
81r1 = Resistor(50e3)
82r1.ohms = 10e3

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected