Working on 2017/09 part 2
This commit is contained in:
parent
7a29670437
commit
ef196af7e3
@ -4,7 +4,7 @@ from pprint import pprint
|
||||
|
||||
input_f = 'input'
|
||||
|
||||
part = -1
|
||||
part = 2
|
||||
#########################################
|
||||
# #
|
||||
# Part 1 #
|
||||
@ -29,8 +29,17 @@ if part == 1:
|
||||
|
||||
#########################################
|
||||
# #
|
||||
# Part 2 #
|
||||
# not working Part 2 #
|
||||
# #
|
||||
#########################################
|
||||
if part == 2:
|
||||
exit()
|
||||
with open(input_f) as file:
|
||||
for line in file:
|
||||
print(line.rstrip(), end=' ')
|
||||
clean_string = line.rstrip()
|
||||
clean_string = re.sub(r"!.",'',clean_string)
|
||||
print(clean_string)
|
||||
clean_string = re.findall(r"<.*?>", clean_string)
|
||||
for c in clean_string:
|
||||
clean_string = c.replace('<','',1).replace('>','',1)
|
||||
print(len(clean_string))
|
||||
|
7
2017/09/test2
Normal file
7
2017/09/test2
Normal file
@ -0,0 +1,7 @@
|
||||
<>
|
||||
<random characters>
|
||||
<<<<>
|
||||
<{!>}>
|
||||
<!!>
|
||||
<!!!>>
|
||||
<{o"i!a,<{i<a>
|
Loading…
Reference in New Issue
Block a user