Why are Python strings immutable? Best practices for using them

What are the design reasons of making Python strings immutable? How does it make programming easier? I’m used to mutable strings, like the ones in C. How am I supposed to program without mutable strings? Are there any best practices? Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the … Read more

int([x[, base]]). Square brackets in functions in Python documentation?

When one or more top-level parameters have the form parameter =
expression, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding argument may
be omitted from a call, in which case the parameter’s default value is
substituted. If a parameter has a default value, all following
parameters must also have a default value — this is a syntactic
restriction that is not expressed by the grammar.

Limiting Python input strings to certain characters and lengths

I just started learning my first real programming language, Python. I’d like to know how to constrain user input in a raw_input to certain characters and to a certain length. For example, I’d like to show an error message if the user inputs a string that contains anything except the letters a-z, and I’d like to show one of the user inputs more than 15 characters.