Python Python Basics Functions and Looping Create a Function

Felix Belga
Felix Belga
4,267 Points

what am I doing wrong

it a python squaring function

squaring.py
import math

def square(number):
    number = value*value
    return number
value = input()


print("The answer is number")

1 Answer

Mark Ryan
Mark Ryan
Python Web Development Techdegree Graduate 19,696 Points

Hi Felix,

You've got the right idea. If this is for the challenge, you only require the function that you have already written (take out importing math, take out value=input(), and take out your print statement). All of that could have been used in another scenario but not for the challenge. Your answer should be three lines. Also, you want to pass value into your function not number. Number is what you're returning. I hope this helps you!