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 trialTinotenda Mangarai
3,828 PointsI am trying to create
What is wrong with my code below
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))
1 Answer
gavynp2020
Python Development Techdegree Graduate 9,009 PointsHi 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?
Tinotenda Mangarai
3,828 PointsI have corrected that but still receiving the EOF error
boi
14,242 PointsApparently, EOF occurs when there is a missing parenthesis.
gavynp2020
Python Development Techdegree Graduate 9,009 PointsCan you save your work, run it again and attach another screenshot of your code with the error?
gavynp2020
Python Development Techdegree Graduate 9,009 Pointsgavynp2020
Python Development Techdegree Graduate 9,009 PointsHi 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?