+1 vote
in Class 11 by kratos

How you can “update” an existing string ?

1 Answer

+5 votes
by kratos
 
Best answer

You can “update” an existing string by (re) assigning a variable to another string

The new value can be related to its previous value or to a completely different string altogether.

Following is a simple example :

!/usr/bin/python

var1 = ‘Hello World!’

print”Updated String:-“,var i[:6] + ‘Python’

...