Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bfb0447

Browse files
Fix sphinx/build_docs warnings for maths/zellers_congruence (TheAlgorithms#12481)
* Fix sphinx/build_docs warnings for maths/zellers_congruence * Fix
1 parent c932883 commit bfb0447

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎maths/zellers_congruence.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
def zeller(date_input: str) -> str:
66
"""
7-
Zellers Congruence Algorithm
8-
Find the day of the week for nearly any Gregorian or Julian calendar date
7+
| Zellers Congruence Algorithm
8+
| Find the day of the week for nearly any Gregorian or Julian calendar date
99
1010
>>> zeller('01-31-2010')
1111
'Your date 01-31-2010, is a Sunday!'
1212
13-
Validate out of range month
13+
Validate out of range month:
14+
1415
>>> zeller('13-31-2010')
1516
Traceback (most recent call last):
1617
...
@@ -21,6 +22,7 @@ def zeller(date_input: str) -> str:
2122
ValueError: invalid literal for int() with base 10: '.2'
2223
2324
Validate out of range date:
25+
2426
>>> zeller('01-33-2010')
2527
Traceback (most recent call last):
2628
...
@@ -31,30 +33,35 @@ def zeller(date_input: str) -> str:
3133
ValueError: invalid literal for int() with base 10: '.4'
3234
3335
Validate second separator:
36+
3437
>>> zeller('01-31*2010')
3538
Traceback (most recent call last):
3639
...
3740
ValueError: Date separator must be '-' or '/'
3841
3942
Validate first separator:
43+
4044
>>> zeller('01^31-2010')
4145
Traceback (most recent call last):
4246
...
4347
ValueError: Date separator must be '-' or '/'
4448
4549
Validate out of range year:
50+
4651
>>> zeller('01-31-8999')
4752
Traceback (most recent call last):
4853
...
4954
ValueError: Year out of range. There has to be some sort of limit...right?
5055
5156
Test null input:
57+
5258
>>> zeller()
5359
Traceback (most recent call last):
5460
...
5561
TypeError: zeller() missing 1 required positional argument: 'date_input'
5662
57-
Test length of date_input:
63+
Test length of `date_input`:
64+
5865
>>> zeller('')
5966
Traceback (most recent call last):
6067
...

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /