Ask Question
10 May, 03:02

Writing a function. Write a function named weird that takes one input and always returns the number 42 (thus ignoring its input). In this question, include this specific docstring: '''This function always returns 42.'''

+3
Answers (1)
  1. 10 May, 05:55
    0
    def weird (inp):

    """This function always returns 42"""

    return 42

    Explanation:

    As specified in the question, this function even though it receives one parameter in this case inp It will always return the value 42.

    The docstring is added to the code.

    A docstring is a way of adding documentation which describes what a function, class or module does. It appears as the first line in the function's body with tripple quotes.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Writing a function. Write a function named weird that takes one input and always returns the number 42 (thus ignoring its input). In this ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers