Strings in Python, Python Strings Tutorials, Python Tutorials, Python for Beginners, How to Delete String, Delete in Python, String in Hindi, Python Programming, Python Tutorials in Hindi
Greetings Viewers,
In the series of strings and operations, now we will see how to do deletion with strings.
How to delete characters of a string?
Previously, we learned that strings are immutable i.e. it cannot be modified. Hence, deleting specific characters will give a TypeError.
Deleting the entire string is possible?
Yes, deleting the entire string is possible.
Example:
my_str = “SDP”
del my_str[2] // deleting characters will raise IndexError due to immutability of strings
print(my_str)
Output:
IndexError
For deleting entire string: del my_str // whole string will be delete
Practice!
Make sure that you didn’t miss this crucial and easy part.
Thank You!
N Yess !! Don’t hesitate to share your precious suggestions/feedbacks!! Get your all doubts crystal clear!!
-----------------------------------------------------------------------------------------------------------------------------------
If you have missed anything regarding python, surf through these links below:
String Is Immutable or Mutable: • Whether String Is Immutable or Mutable #5 ...
Concatenation and Overriding in String: • Concatenation and Overriding in String #4 ...
Errors in String Declaration: • Type Error and Index Error in String #3 | ...
String Slicing in Python: • How to Access Python String Character #2 |...
How to Store String in Variable: • Python String #1 | String Theory | How to ...
NameError in Python: • NameError in Python #10 | Exception Handli...
KeyError in Python: • KeyError in Python #9 | Exception Handling...
ImportError in Python: • ImportError in Python #8 | Exception Handl...
AttributeError In Python: • AttributeError In Python #7 | Exception Ha...
--------------------------------------------------------------------------------------------------------------------------------------
You’ll also find us here!!
Website: https://sdpguruji.in/
Play Store App: https://play.google.com/store/apps/de...
Instagram: / sdpguruji
Facebook: / sdp.guruji.3
LinkedIn: / sdpguruji
Telegram: https://t.me/sdpguruji
--------------------------------------------------------------------------------------------------------------------------------------
For more such informative Python videos,
color the thumbs up button blue, share the videos, and yes don’t forget to hit the subscribe button and press the bell icon for remainders.
Stay Tuned!!!
#SDPGuruji
#sdpguruji
#strings
#pythonstring
#deletestring
#pythontutorials
#stringsinpython
#pythonprogramming
#PythonSDPGuruji
#PythonTutorial
#Hindi
En esta página del sitio puede ver el video en línea How to Delete Entire String #6 | String Tutorial | String in Python| Python Programming | SDP Guruji de Duración hora minuto segunda en buena calidad , que subió el usuario SDP Guruji 05 diciembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 612 veces y le gustó 23 a los espectadores. Disfruta viendo!