Confused with to use dots or parantheses


Just a little confused on when to use which syntax. Some times it seems like my variable should be variable.method() and others seem like method(variable). Such as...


That was just from one lesson to the next. Is there a way to tell going forward when something should go before and when it should go in parentheses?


In the Dot Notation lesson you'll know it.

Methods that use dot notation only work with strings.

On the other hand, len() and str() can work on other data types.


a little elaboaration on rcodeman's post, examples include .condition, .angle, etc
in future, you will get to use .variable, where variable can be anything you set is as.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.