TIL (again): isdigit()

This commit is contained in:
Stefan Harmuth 2023-12-01 08:14:53 +01:00
parent ccefb7e6f0
commit e5345351bd

View File

@ -26,7 +26,7 @@ class Day(AOCDay):
if line.startswith(n): if line.startswith(n):
dig += str(i) dig += str(i)
if ord("0") <= ord(line[0]) <= ord("9"): if line[0].isdigit():
dig += line[0] dig += line[0]
line = line[1:] line = line[1:]