79426090

Date: 2025-02-10 04:54:31
Score: 1
Natty:
Report link

Python's range() function and the match statement treat ranges differently. You create a range using range(start, stop, step) (only positional arguments). But when you match a range in a case statement, you must use case range(start=x, stop=y, step=z). It's a weird quirk, but that's how it works. Don't try to use other keyword names or positional arguments in the case – it won't work.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Amardeep Singh