From def2413f91b46161a8adc9e92a6300a1f54ada29 Mon Sep 17 00:00:00 2001 From: Daniel Tschertkow Date: Mon, 23 Nov 2020 01:11:37 +0100 Subject: [PATCH] read_plaintext() wird zu read_text() und Text wird lower() --- src/libex01.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libex01.py b/src/libex01.py index 91a5d53..9dd35c4 100644 --- a/src/libex01.py +++ b/src/libex01.py @@ -4,7 +4,7 @@ module to encapsulate common functions for exercise01. import string -def read_plaintext(file_path): +def read_text(file_path): """ funciton to read plaintext from a file into a string variable. Skips non-alphabetic characters (including whitespace) and converts the rest to lower case. @@ -12,7 +12,7 @@ def read_plaintext(file_path): txt = "" with open(file_path, "r") as _file: for line in _file: - for char in line: + for char in line.lower(): if char in string.ascii_letters: txt += char return txt