modify previous solutions to only strip newline character from line

This commit is contained in:
kjubik 2025-01-06 15:55:55 +01:00
parent 9af9a726b4
commit d58a672aa5
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import re
import sys
for line in sys.stdin:
line = line.strip()
line = line.strip('\n')
if re.match(r'^-?[1-9][0-9]*0$|^-?[1-9][0-9]*5$|^0$', line):
print('yes')
else:

View File

@ -16,7 +16,7 @@ def get_number(c):
return result
for line in sys.stdin:
line = line.strip()
line = line.strip('\n')
if not re.match(pattern, line):
print('no')
continue