I've been trying to use a match case instead of a million IF statements, but anything I try returns the error:
match http_code:
^
SyntaxError: invalid syntax
I've also tried testing examples I've found, which also return this error, including this one:
http_code = "418"
match http_code:
case "200":
print("OK")
case "404":
print("Not Found")
case "418":
print("I'm a teapot")
case _:
print("Code not found")
I'm aware that match cases are quite new to python, but I'm using 3.10 so I'm not sure why they always return this error.