Python Data Structures #3: String Object

Veröffentlicht am: 04 September 2017
auf dem Kanal: Brian Faure
11,934
179

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 #1 - First Steps  

Further reading material: https://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.


Auf dieser Seite können Sie das Online-Video Python Data Structures #3: String Object mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Brian Faure 04 September 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 11,934 Mal angesehen und es wurde von 179 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!