Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
8,669 Points

Apparently, EOF occurs when there is a missing parenthesis.