Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 4

8 bytes added, 09:23, 21 June 2017
PART 1 - Strings and Substrings
:#If a string contains many values separated by a single character, such as a space, the string can be split on those values and create a list of values<source>
lower_name.split(' ') # Provide the split() function with a character to split on
</source>The above example will return a list of strings, which we can access just like all of lists. <br><br>
:#Let's practice more string manipulation by issuing the following:<source>
list_of_strings = lower_name.split(' ') # Split string on spaces and store the list in a variable
13,420
edits