Skip to content

Commit 586cbd6

Browse files
committed
day02: remove redundant strip()
1 parent e23a731 commit 586cbd6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

day02/1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main():
66
score = 0
77
for line in sys.stdin:
8-
rnd = line.strip().split()
8+
rnd = line.split()
99
opp = ord(rnd[0]) - ord('A') # ascii
1010
me = ord(rnd[1]) - ord('X') # haxx!
1111
score += me + 1 + ((me - opp + 1) % 3) * 3

day02/2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main():
66
score = 0
77
for line in sys.stdin:
8-
rnd = line.strip().split()
8+
rnd = line.split()
99
opp = ord(rnd[0]) - ord('A') # ascii
1010
me = (ord(rnd[1]) - ord('X') - 1 + opp) % 3 # haxx!
1111
score += me + 1 + ((me - opp + 1) % 3) * 3

0 commit comments

Comments
 (0)