Implement a function

Report a typo

Write the code that corresponds to the docstring of the function. In the code, you should check whether the input number is positive, otherwise, it should return the string "Enter a positive number!". Note that zero is neither a positive nor a negative number.

You don't need to take any input or call the function. Just write the body of get_number().

Write a program in Python 3
def get_number(num):
"""Return the number one less than the given positive number.
If the number is nonpositive, return a string "Enter a positive number!".

Arguments:
num -- an integer.
Return values:
An integer one less than the input number.
"""
pass
___

Create a free account to access the full topic