Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Functions and Looping Create a Function

I am trying to create

What is wrong with my code below

squaring.py
def square(number):
    return number * 2
yyour_number = int(input("Enter any number: "))
squared_number = square(your_number)
print("The square of your number is {}".format(squared_number))
gavynp2020
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
gavynp2020
Python Development Techdegree Graduate 9,009 Points

Hi Tinotenda,

The error you are probably receiving is "your_number" is not defined. Take a look at your variable spelling for "your_number". Does this help?

1 Answer

gavynp2020
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
gavynp2020
Python Development Techdegree Graduate 9,009 Points

Hi Tinotenda,

The error you are probably receiving is "your_number" is not defined. Take a look at your variable spelling for "your_number". Does this help?

I have corrected that but still receiving the EOF error

boi
boi
14,242 Points

Apparently, EOF occurs when there is a missing parenthesis.