From 030dd0b611052a5b2d56bd8615429456a222b6ae Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:53:46 -0500 Subject: [PATCH] Make autograder happy or whatever Autograder has some issues, but these should fix them. Basicly they just reinforce that the autograder should not be doing anything wrong when running the code (being more explicit) --- 7/7.9 LAB/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/7/7.9 LAB/main.py b/7/7.9 LAB/main.py index a69aec1..9802d64 100644 --- a/7/7.9 LAB/main.py +++ b/7/7.9 LAB/main.py @@ -26,7 +26,7 @@ def save_output_keys(showdict): showdict = dict(sorted(showdict.items())) # Sort the dict by key for entry in showdict: # For every dict entry in our show dict - result += '{0}: '.format(entry) # Append a new line to represent that entry season count + result += '{0}: '.format(int(entry)) # Append a new line to represent that entry season count if isinstance(showdict[entry], list): # If the entry is a list of shows for show in showdict[entry]: # for very entry in that list of shows result += '{0}; '.format(show) # append that show, and a ";" @@ -34,7 +34,7 @@ def save_output_keys(showdict): else: # If the entry is not a list result += '{0}'.format(showdict[entry]) - with open('output_keys.txt', 'a') as f: + with open('output_keys.txt', 'w') as f: f.write(result) def save_output_titles(showdict): @@ -52,7 +52,7 @@ def save_output_titles(showdict): for item in result: # Convert list to stirng, with \n resultstring += str(item) + '\n' - with open('output_titles.txt', 'a') as f: + with open('output_titles.txt', 'w') as f: f.write(resultstring) if __name__ == '__main__':