Python Python Basics Functions and Looping Create a Function

Shahla Jalali
Shahla Jalali
589 Points

create a function named square

Create a function named square---

what is the answer?

squaring.py
def square(number):
    return number * 2

answer_due = float(input("What is the square of? "))

square_is = square(number)

print("The square of {}".format(square_is))

1 Answer

The square function should return the number times itself. You are returning the number times 2.

The code below the function shouldn't be included in the challenge. But for testing purposes

square_is = square(number)

should use the variable you created that stores the input

square_is = square(answer_due)