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
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