The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #883
def my_function(my_var: str) -> str:
return 2 * my_var
Even if we give an hint to Python that the function is expected to return a string with -> str , it doesn't mean that the function has to return a string. In this case, if an integer is passed to the function as an argument, the function will return another integer without exceptions. (python.org/dev/peps/pep-0484)
Question difficulty: 🔵🔵🔵🔵🔵
Similar questions: