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)
This commit is contained in:
Joe S 2021-02-22 19:53:46 -05:00
parent 83fb61e63b
commit 030dd0b611
1 changed files with 3 additions and 3 deletions

View File

@ -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__':