01-solution
This commit is contained in:
21
01/01.py
21
01/01.py
@@ -2,20 +2,21 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
def numword2int(text):
|
def numword2int(text):
|
||||||
text = text.replace("one", "1")
|
text = text.replace("one", "o1e")
|
||||||
text = text.replace("two", "2")
|
text = text.replace("two", "t2o")
|
||||||
text = text.replace("three", "3")
|
text = text.replace("three", "t3e")
|
||||||
text = text.replace("four", "4")
|
text = text.replace("four", "f4r")
|
||||||
text = text.replace("five", "5")
|
text = text.replace("five", "f5e")
|
||||||
text = text.replace("six", "6")
|
text = text.replace("six", "s6x")
|
||||||
text = text.replace("seven", "7")
|
text = text.replace("seven", "s7n")
|
||||||
text = text.replace("eight", "8")
|
text = text.replace("eight", "e8t")
|
||||||
text = text.replace("nine", "9")
|
text = text.replace("nine", "n9e")
|
||||||
# text = text.replace("zero", "0")
|
# text = text.replace("zero", "0")
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
input_file = open("input", "r")
|
input_file = open("input-org", "r")
|
||||||
|
|
||||||
summe = 0
|
summe = 0
|
||||||
for line in input_file:
|
for line in input_file:
|
||||||
v1, v2 = "", ""
|
v1, v2 = "", ""
|
||||||
|
|||||||
1000
01/input-org
Normal file
1000
01/input-org
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user