Updating strings

We can update a string by reassigning a new value to the specified index. Refer to the following example:

#!/usr/bin/python3
str1 = 'Hello Python!'
print ("Updated String: - ", str1 [:6] + 'John')

Output:
Updated String: - Hello John
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset