Difference between revisions of "print 1 word of string in python"
From thelinuxwiki
(Created page with " mystring = 'cheetahs run real fast' print mystring.split()[2] real the [index] starts at zero") |
|||
Line 1: | Line 1: | ||
mystring = 'cheetahs run real fast' | mystring = 'cheetahs run real fast' | ||
+ | |||
print mystring.split()[2] | print mystring.split()[2] | ||
Latest revision as of 01:19, 31 May 2024
mystring = 'cheetahs run real fast'
print mystring.split()[2]
real
the [index] starts at zero