MCPcopy 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
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 1

item_058.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected