I'm starting to get a little frustrated with CodeAcademy.
I'm jumping into their Python lessons because why the fuck not. Frequently, whenever I've completed a lesson I want to do some more playing with the code. Unfortunately there's no way to reset without moving on and returning to the lesson, which is annoying.
However, more frustrating is the fact that every time I want to play with my code, it's fucked up in some way. I don't feel like I've really learned anything outside of doing the prescribed steps involved in the particular lesson. Further, there's very limited resources to tell me exactly what I've done wrong.
Take this for example.
The lesson is to define a squaring function. Easy enough. However, the lesson is literally "Just call the function! Confused? The answer is squared(10) isn't programming accessable? :^)"
I said fuck that I want to be able to call this function on a user defined number.
def square(n):
"""Returns the square of a number."""
squared = n**2
print "%d squared is %d." % (n, squared)
return squared
# Call the square function on line 9! Make sure to
# include the number 10 between the parentheses.
number = raw_input("Gimmie a number, chump")
square(number)
How am I expected to know to use
int(raw_input("number is"))
since halfway through the course they have yet to explain the difference between strings and integers? Let alone how to input them?