Fixed spliting at spaces issue

This commit is contained in:
2025-09-18 08:10:15 -04:00
parent 070d6dbe3e
commit 5aba700f48
4 changed files with 10 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ import sys
# All modules for CS 412 must include a main method that allows it
# to imported and invoked from other python scripts
def main():
sounds: list[str] = sys.stdin.readline().strip().split(" ")
sounds: list[str] = sys.stdin.readline().strip().split()
num_animals: int = int(sys.stdin.readline().strip())
animal_map: dict[str, str] = {}

View File

@@ -12,18 +12,17 @@ import sys
# to imported and invoked from other python scripts
def main():
sounds: list[str] = sys.stdin.readline().strip().split(" ")
sounds: list[str] = sys.stdin.readline().strip().split()
num_animals: int = int(sys.stdin.readline().strip())
fox_sounds: list[str] = []
animals_ecountered: list[str] = []
animal_sounds: list[tuple[str, str]] = list(
map(
lambda line: line.strip().split(" goes "),
sys.stdin.readlines()[:num_animals],
)
)
animal_sounds: list[tuple[str, str]] = []
for line in sys.stdin.readlines()[:num_animals]:
split_line = line.strip().split(" goes ")
animal_sounds.append((split_line[0], split_line[1]))
for sound in sounds:
animal_found = False