Тёмный
No video :(

Python Data Structures #3: String Object 

Brian Faure
Подписаться 13 тыс.
Просмотров 12 тыс.
50% 1

In this video we'll begin by discussing the basics of the Python string, later, we'll open up a coding editor and showcase some of the more important functions built into the object.
MISTAKE! As pointed out by Akshat Barbhaya, strings in Python are immutable and don't support setting individual characters. Alternatively you can get around this (although I don't recommend it) by converting the string to a list, changing the character, then joining the list back into a string.
If you're interested in Python GUI development check out my video series starting with: • Python GUI Development...
Further reading material: docs.python.org/2/library/str...
The string module contains a number of useful constants and classes, as well as some deprecated legacy functions that are also available as methods on strings. In addition, Python’s built-in string classes support the sequence type methods described in the Sequence Types - str, unicode, list, tuple, bytearray, buffer, xrange section, and also the string-specific methods described in the String Methods section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. Also, see the re module for string functions based on regular expressions.

Опубликовано:

 

3 сен 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@akdb21
@akdb21 5 лет назад
2:26 Characters cannot be set as strings are immutable!
@BrianFaure1
@BrianFaure1 5 лет назад
Hi Akshat, thanks for catching this mistake, unfortunately RU-vid no longer supports annotations so I can't make it clear that this is incorrect. I'll pin your comment though in hopes people see it and put a message in the description. Sorry for any confusion this may have caused, I'm not sure how I let that slip through. I guess I've never tried setting a character specifically and for some reason figured the string was more similar to a list than it actually is.
@akdb21
@akdb21 5 лет назад
@@BrianFaure1 No problem! Thanks for amazing videos on data structures in Python!
@jingyuchang1885
@jingyuchang1885 6 лет назад
Very good video Brian! You explain everything so clear! Thanks again for making the videos and sharing them with people who are eager to learn!!
@austinmitchell2652
@austinmitchell2652 6 лет назад
Your videos are great and easy to understand for me, thanks for doing what you do!
@micmike
@micmike Год назад
Hello, yes I do enjoy your videos and teaching method/style. Wish there were more video's to view.
@jimmorrisshen
@jimmorrisshen 6 лет назад
Nice video.
@RandomShowerThoughts
@RandomShowerThoughts 5 лет назад
man you didn't close the file after reading it, hurts my soul lmfao
Далее