
I have to say I seem to run into a little ‘something’ I hadn’t forseen when I started this journey.
As I follow the exercises on codecademy, I often wonder why in bananas name the code I wrote to solve the problem at hand doesn't work.
I mean admittedly, half of the time it's just plain wrong, I am still learning after all and it IS a new language.
But the other half of the time it doesn't work, I am near 100% sure it should. I trace every character, but they're all there.
What it then turns out to be is that Python, as opposed to maxscript, is case-sensitive. Meaning that the exercise expects for instance something to be called MonkeySee, but I made it return monkeysee ...
Syntax, therefor is a very important thing to learn when learning a programming language.
Another example is that where max doesn't really care about formatting, Python is very particular in it's use of indentation (tabs, spaces) for 'subcode' of let's say a function.
for instance:
def MonkeySee (action):
print(action)
monkeySee("monkeyDo")
would work and spit out the string monkeyDo to the console, but !
def MonkeySee (action):
print(action)
monkeySee("monkeyDo")
will return an error about indentation (luckily, Pythons' error reporting is quite good at this level)
IndentationError: expected an indented block
Command exited with non-zero status 1
Another example is that I've learned with maxscript that something requires a specific action.
if o == true do (
code
)
above is the case for a single action, but if i want to do an if, then, else then I would need to structure it differently. Notice that the do now needs to be a then
if o == true then (
code
) else (
code
)
while Python on this end is rather more forgiving in this regard.
if o == True:
code
or
if o == True:
code
else:
other code
see how this is slightly more forgiving in that I could just add an else afterwards (or even an elif for an if, else if, else structure) Then again, do take notice of the uppercase T for True ... again, case-sensitive Python being a *
Well, I suppose in the end it's mostly a matter or repetition to ingrain the syntax into my grey and greying mass alongside my embedded maxscript syntax memory.
Let's hope there's room for the both of them !
Full STEEM ahead my fellow Steemians - @eqko
Me and my fellow blockbrothers are a witness as @blockbrothers. If you want to support us we would appreciate your vote here. Or you could choose to set us as your proxy.
Vote for @blockbrothers via SteemConnect
Set blockbrothers as your proxy via SteemConnect
As blockbrothers, we build Steemify, a notification app for your Steemit account for iOS.
Get it Here:
Thanks fors sharing valuable info with u
its really infoemative☺
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit