Python Python Basics Functions and Looping Create a Function

Defining the function

I'm not sure if I'm way off or not. Am I defining correctly?
import math

def square(number)
    return number * number

number = int(input())
10,600 Points

EDIT woops sorry, didn't see the second step.

There's no need to import math in this challenge. Also the challenge asks you to assign the output of your function to "result"

you only need the following:

def square(number):
    return number * number

result = square(3)

2 Answers

Miss Lucy Andresen
Miss Lucy Andresen
392 Points
def square(TheNumber):
    return number * number

number = int(input("please insert a number"  ))
the_ancear = square(number)
print("the square root of {} is".format(number),the_ancear)

your missing some dots and the name of the def was the same as the input they need to be different names I also put in some user text and a print statement with a bit of formatting to see what you are doing

You forgot to put the colons after defining the function . def square(number): return number*number There is no need of importing math and using the input method because it is not asked for.

Happy coding