mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
refactor: Indent ... for visual purposes (#7744)
This commit is contained in:

committed by
GitHub

parent
e8915097c4
commit
9bba42eca8
@ -47,7 +47,7 @@ def is_valid(barcode: int) -> bool:
|
||||
False
|
||||
>>> is_valid(dwefgiweuf)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
NameError: name 'dwefgiweuf' is not defined
|
||||
"""
|
||||
return len(str(barcode)) == 13 and get_check_digit(barcode) == barcode % 10
|
||||
@ -61,7 +61,7 @@ def get_barcode(barcode: str) -> int:
|
||||
8718452538119
|
||||
>>> get_barcode("dwefgiweuf")
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
ValueError: Barcode 'dwefgiweuf' has alphabetic characters.
|
||||
"""
|
||||
if str(barcode).isalpha():
|
||||
|
@ -15,7 +15,7 @@ def join(separator: str, separated: list[str]) -> str:
|
||||
'You are amazing!'
|
||||
>>> join("#", ["a", "b", "c", 1])
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
Exception: join() accepts only strings to be joined
|
||||
"""
|
||||
joined = ""
|
||||
|
Reference in New Issue
Block a user