please am frustrated by the challenge to create function, am failing over and over, kindly assist!
Create a function named square...
def split_check(square): return square*2
Maxwell Newberry7,676 Points
In your return statement you are simply multiplying the argument by 2, when the challenge is asking for you to square the number. Meaning, multiply the passed argument by itself, not by 2.
def square(number): return number * number
Don't be frustrated! It takes time and you're definitely on the right track. :)
David GarciaPython Web Development Techdegree Student 3,384 Points
Tip: read the questions very carefully they tell you how to do said problem but you must come up with the logic...
1: first you need to create a defined function called 'square' that takes an argument called 'number' example: def example(argument):
2: then create the value of said argument called number inside defined function and tell it what it means example: def example(argument): argument = argument * argument
3: then return said value as soo....:
def example(argument): argument = argument * argument return argument
if you don't understand this, here's the answer. I'd advise you to look at the answer and study from it and remember what it does also remember there's different ways of doing problems.
def square(number): number = number * number return number
def square(number): number=number*number return number