From 40e1c67559dc8e14d323a955691414ba22a123bd Mon Sep 17 00:00:00 2001 From: test Date: Wed, 29 Mar 2023 11:17:58 +0200 Subject: [PATCH] 'a' --- main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..bf35448 --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +with open('dev-0/out.tsv', 'w', newline='\n') as fout: + with open('dev-0/in.tsv', encoding='utf-8') as fin: + for line in fin.readlines(): + prob1 = len(line) % 5 + 1 + prob1 = round(prob1/10, 1) + prob2 = round(0.9 - prob1, 1) + prob3 = round(1 - prob1 - prob2, 1) + word = 'on' if prob1 < 0.3 else 'in' + result = f'{word}:{prob1} a:{prob2} :{prob3}\n' + print(result) + fout.write(result)