Newb with newb questions about Python/programming

I'm a non-technical type trying to learn some coding skills and I figured I'd start with Python because the syntax is simple. One thing I'm seeing is there's usually at least 2 ways to do everything. 

For example:

len(array)   and  array.__len__( )

Is there any difference (advantage/disadvantage) between either way of finding, as one example, the length of a string?  From reading a little bit it seems like there can be a question of performance associated with different ways of doing things? As another example array.__contains__('Bob') versus 'Bob' in array...do performance issues only arise when you're scaling stuff up to enterprise scale? 

What's the difference between the array.__len__( ) *type of* methods and the array.sort( ) *type of* methods? All data structures (perhaps minus tuples) seem to have some combination of the array.__something__( )  and the array.something( ) methods.

Also, how do you go from understanding the syntax to understanding how the tools can be used to solve problems and what advantages and disadvantages different tools have for solving problems? Is it just a matter of going and doing? 

The only mildly useful thing I've come up with so far is a program to 'encrypt' with the Caesar cipher and save text files on my hard drive so nosy people who I share my laptop with won't read $hit on my hard drive. I think I need to come up with some kind or project that requires more than 20-30 minutes to write and figure out. 

I don't know about Python or your specific questions but while you're waiting for someone more informed to respond to this thread why not check out this thread: https://teksyndicate.com/forum/code/programming-super-thread/142214

I haven't looked through all of it yet but I'm sure it's filled with tons of helpful information and it may even answer your questions! 

I don't know for sure but I can imagine that “len(array)”   and  “array.__len__( )” are the same. On your level of experiance I would not consider the issue of performance too much and just try to write good readable code. You can worry about the performance of loops for example (e.g. assinging the same value to a variable in a loop over and over again is more expensive than just assigning it once before the loop)

In my understanding __uiae__() and uiae() are just names of methods (did you learnd about object orientation already?) - names with __ are just a convention to show something.

To come from “learning” to “using” the syntax is an interesting point. Usually it just comes with time. Try to solve more problems / write more programs, like your encryption program (which is pretty nice btw), and try to read from now and then what others do.

This might help http://stackoverflow.com/questions/8689964/python-why-do-some-functions-have-underscores-before-and-after-the-functio

^ this

Double underbar names are used for internal mechanisms. The len() function finds an object's length by calling the object's __len__ method. Overriding these methods allows you to customize how your objects behave. Another example is __repr__. When you print(someobject) the object has its __repr__ method called to create a text description of that object. __init__ is the constructor for classes, that gets called when an object of that class is created. Generally you would define methods with these signatures but rarely do you explicitly call them. They are hooks for the internal mechanisms of the language.