Title: Breaking Up String Variables
Slug: breaking_up_string_variables
Summary: Breaking Up String Variables
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
In [15]:
variableName = 'This is a string.'
In [16]:
One, Two, Three = [1, 2, 3]
In [17]:
firstLetter, secondLetter, thirdLetter, fourthLetter = 'Bark'
In [18]:
firstLetter
Out[18]:
In [19]:
secondLetter
Out[19]:
In [20]:
thirdLetter
Out[20]:
In [21]:
fourthLetter
Out[21]:
In [22]:
firstNumber, secondNumber, thirdNumber, fourthNumber = '9485'
In [23]:
firstNumber
Out[23]:
In [24]:
secondNumber
Out[24]:
In [25]:
thirdNumber
Out[25]:
In [26]:
fourthNumber
Out[26]:
In [27]:
a, *b = 'spam'
a
Out[27]:
In [28]:
b
Out[28]: