Skip to content

Python strings cannot be changed . Not true #137903

@tulliog

Description

@tulliog

This page
https://docs.python.org/3/tutorial/introduction.html

states: "Python strings cannot be changed — they are immutable".

As it is written, it is a wrong statement. This example proves it:

>>> myString = 'Python3'
>>> myString 
'Python3'
>>> myString = 'Perl'
>>> myString 
'Perl'
>>> 

Maybe what the documentation intended to say is that we cannot change parts of strings using indexes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions