Skip to content

Commit 98c34a2

Browse files
committed
Regex and Parsing 6
1 parent 8e858f6 commit 98c34a2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Regex Substitution
2+
# https://www.hackerrank.com/challenges/re-sub-regex-substitution/problem
3+
4+
import re
5+
6+
for i in range(int(input().strip())):
7+
print(re.sub(r'(?<= )\|\|(?= )', 'or', re.sub(r'(?<= )&&(?= )', 'and', input())))

0 commit comments

Comments
 (0)