Here\'s the question that I\'m supposed to code for:
Write the contract, docstring and implementation for a function showCast that takes a movie title and
Maybe these snippets help you:
Printing a table row
def printRow(character, actor):
print(character + (20 - len(character)) * ' ' + actor))
Sorting the characters
def getSortedTitleList(titleList):
sortedList = []
characters = sorted(titleList)
for character in characters:
sortedList.append((character, titleList[character]))
return sortedList
Note: I changed dict.keys().sort()
to sorted(dict)
to be compatible with Python 3.