Brian Steyer9,026 Points
Where can i find an example of how to assign a specific variable to square the integer in this function? Thanks!
Are there more reference points where I can look to ensure the formatting and syntax of my code are on target? Thanks!
def square(number): number = (number**)
Antonio De Rose19,854 Points
def square(number): number = (number**) # 3 errors # 1, you've been asked to return, so dont assign to number, use return # 2, syntax error, take off the parenthesis, surrounded by the number** # 3, square is write like, square**2 or simply square * square
P S10,180 Points
Hey, You actually don't have to worry about assigning the value to a variable within the function, just return it. For task 1 of 2 it wants you to simply make a function that accepts a number and return the number squared. Like so,
def square(number): return number**2
For task 2 of 2, it wants you to call the function, give it an argument of 3, then store the result in a variable called result.
result = square(3)