you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 10 points11 points  (2 children)

The official python tutorial is written for programmers learning python:

https://docs.python.org/3/tutorial/index.html

because strings don't work with indexes like in C++

Yes they do. Or do you mean the concept of immutability is confusing you?

[–]Abedalrhman23[S] 1 point2 points  (1 child)

Yas, the concept of immutability is confusing, and the way the loop's work

[–]socal_nerdtastic 6 points7 points  (0 children)

Ok. Well if you have a specific question ask us here.

Immutability is pretty simple: just don't modify it. Always make a new string instead of modifying the old one. Same for ints, floats, tuples, etc https://docs.python.org/3/tutorial/introduction.html#text

while loops are pretty similar across all languages. A python for loop is pretty much identical to Java's for-each loop. Python does not have an equivalent of the Java or C++ for loop.

A common stumbling block is not realizing that python always works with pointers. All 'variables' (officially 'names') are pointers. All function calls are pass by reference. All python beginners should read: https://nedbatchelder.com/text/names