The correct answer is: B. Insert
The insert()
method allows you to insert a new character, substring, or list of characters at a specific position in a string.
The remove()
method allows you to remove a character, substring, or list of characters from a string.
The import()
method allows you to import a module into a Python script.
The delete()
method allows you to delete a file from the filesystem.
Here is an example of how to use the insert()
method:
“`python
string = “Hello, world!”
string.insert(5, “!”)
print(string)
Hello, world!!!
“`
In this example, the insert()
method was used to insert the character !
at position 5 in the string "Hello, world!"
. The result is the string "Hello, world!!!"
.