- Home
- Course Detail
regularpython@gmail.com
You are now watching:
Python Strings / of Python String Immutable
name = "www.regularpython.com" print(name) #i s this possible to get data from a string? # Answer: Yes Possible print(name[4]) print(name[1:5]) print(name[3:]) print(name[:5]) print(name[:]) # ************************************************** # # is this possible to update the string? # Answer:No it's not possible name = "www.Tutorialstution.com" name[0]= 'k' print(name) # ************************************************** # # is this possible to Extend the string? #A nswer:No it's not possible name = "www.regularpython.com" print('Before Updation = ', name) name[0]= 't' print('After Updation = ', name) # ************************************************** # # is this possible to delete the data from a string? # Answer:No it's not possible name = "www.Tutorialstution.com" del name[1] print(name) # ************************************************** # # Note: # Finally string are immutable.We can not delete,update and extend.String are read only data type.