Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ Resistor
Class
Resistor
example_code/item_058.py:75–79 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
73
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
1
item_058.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected