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 trialsubhash w
1,143 PointsEOFError when reading a line. can some one help
import math
def square(xyz):
out = int(xyz * xyz)
return out
num = float(input("enter a number"))
square(num)
1 Answer
KRIS NIKOLAISEN
54,971 PointsYou are doing too much:
- The error is because the checker is not going to input a value to the input function
- There is no need to import math
- You don't need to convert your product to an integer
You will need to do the following:
- Create a function named square which you have done
- The function should have a parameter named
number
(not xyz) - return the square which you also have done - just with the wrong parameter name
subhash w
1,143 Pointssubhash w
1,143 PointsThanks Kris for the feedback, will take note of the suggestions.