Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
74
print(
"Example 4"
)
75
class
Resistor:
76
def
__init__(self, ohms):
77
self.ohms = ohms
78
self.voltage = 0
79
self.current = 0
80
81
r1 = Resistor(50e3)
82
r1.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