def keyword_arguments(**keywords):
return sorted(keywords.keys())
if __name__ == '__main__':
print keyword_arguments(arg1 = 1, arg2 = 2, arg3 = 3)
the above code returns ['arg1', 'arg2', 'arg3'] correctly. However, if I replace the return statement in the function like so:
return keywords.keys().sort()
it returns None. Why is this?
sortreturnsNone.