How to Update Strings : Assignment « String « Python Tutorial






aString = 'this is a test'
aString = aString[:6] + 'Python!'
print aString
aString = 'different string altogether'
print aString








5.2.Assignment
5.2.1.How to Update Strings
5.2.2.How to Remove Characters and Strings
5.2.3.To clear or remove a string, you assign an empty string or use the del statement, respectively: