I'm beginning to learn Python. What is wrong with my code?
-------
length = 10
width = 5
print "Area:" int(length) * int(width)
-------
>Pic unrelated
Python sucks
print("Area: " + int(length) * int(width))
>>59519150
To further this, print is a function (look these up) which takes arguments, in this case, what you want to print.
Stop learning python and get on C. Then learn something functional (not python).
>>59519166
He is getting confused trying to print a line. Stick with Python.
>>59519181
Haha this.
>what's wrong with my code?computer please print "x" * "y" thank you
>>59519124
>python 2
Found your problem
>>59519150
Nah do :
print "Area:", length*width
Instead
>>59519259computer make game
>>59519294
What game would you like to play?
print('Area: {}'.format(length * width))
>>59519181
He's confused because of the lack of syntactic constraints. He's doesn't understand that print is a function taking a list of arguments. He needs a more rigid looking language to alert his mind to what he's using.
>>59519166
>>59519929
This
Beginners need to learn the fundamentals with a strongly typed programming language than some dynamically typed scripting language
>>59519124
Your problem is that you forgot to add a whitespace after colon in "Area:".
It will print ugly "Area:666"
Disgusting...
>>59519986
Jesus, kid. Being butt-frustrated isn't cool. Don't get bitchey just for the sake of it.
Your suggestion isn't even above disgusting. Look 3 posts up for the format function
>>59519124
mommy... why is there no semi colons?
Jesus christ python is shit
>>59519124
>dat code
>>>/x/
>>59519124
length = 10
width = 5
print("Area:"+str(int(length) * int(width))
>>59519942
beginners don't need to know how to micro-manage low level shit the compiler can fucking do for you
>>59520991
Err
length = 10
width = 5
print "Area: {0}".format(length * width)