mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
refactor: Replace doctest traceback with ... (#7558)
This commit is contained in:
committed by
GitHub
parent
0f06a0b5ff
commit
393b960525
@@ -25,19 +25,19 @@ def carrier_concentration(
|
||||
('hole_conc', 1440.0)
|
||||
>>> carrier_concentration(electron_conc=1000, hole_conc=400, intrinsic_conc=1200)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 37, in <module>
|
||||
...
|
||||
ValueError: You cannot supply more or less than 2 values
|
||||
>>> carrier_concentration(electron_conc=-1000, hole_conc=0, intrinsic_conc=1200)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 40, in <module>
|
||||
...
|
||||
ValueError: Electron concentration cannot be negative in a semiconductor
|
||||
>>> carrier_concentration(electron_conc=0, hole_conc=-400, intrinsic_conc=1200)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 44, in <module>
|
||||
...
|
||||
ValueError: Hole concentration cannot be negative in a semiconductor
|
||||
>>> carrier_concentration(electron_conc=0, hole_conc=400, intrinsic_conc=-1200)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 48, in <module>
|
||||
...
|
||||
ValueError: Intrinsic concentration cannot be negative in a semiconductor
|
||||
"""
|
||||
if (electron_conc, hole_conc, intrinsic_conc).count(0) != 1:
|
||||
|
||||
@@ -17,15 +17,15 @@ def electric_power(voltage: float, current: float, power: float) -> tuple:
|
||||
result(name='power', value=6.0)
|
||||
>>> electric_power(voltage=2, current=4, power=2)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 15, in <module>
|
||||
...
|
||||
ValueError: Only one argument must be 0
|
||||
>>> electric_power(voltage=0, current=0, power=2)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 19, in <module>
|
||||
...
|
||||
ValueError: Only one argument must be 0
|
||||
>>> electric_power(voltage=0, current=2, power=-4)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 23, in <modulei
|
||||
...
|
||||
ValueError: Power cannot be negative in any electrical/electronics system
|
||||
>>> electric_power(voltage=2.2, current=2.2, power=0)
|
||||
result(name='power', value=4.84)
|
||||
|
||||
Reference in New Issue
Block a user