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!
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
Simon Au5,508 Points
EOF Error when using input
Currently struggling with this EOF problem. Any guidance would be great!
def square(number): return int(number*number) amount = input('Enter the number') result = square(amount)
If you wrap your input request using int() then this returns a number instead of a string.
I done this myself loads of times and you can't see it for looking at it.
I tend to print out my variables and also the type at each stage so I can check if it's a number etc....
def square(number): return int(number*number) amount = int(input('Enter the number ')) result = square(amount) print(result)