Python Python Basics Functions and Looping Create a Function

robin saldanha
robin saldanha
Python Development Techdegree Student 281 Points

Help please

feeling like I hit a wall.. why is this not working?
def square(number):
    return number*number
result = square("3")
print (result)

3 Answers

You're passing it a string "3".

A number is only a number if it doesn't have " surrounding them.

ThatOneCoder -
ThatOneCoder -
8,500 Points

You're making a string instead of a integer at the 3.

make sure you know that when having a number putting " around it won't make it a number.