Difference between revisions of "print 1 word of string in python"

From thelinuxwiki
Jump to: navigation, search
(Created page with " mystring = 'cheetahs run real fast' print mystring.split()[2] real the [index] starts at zero")

Revision as of 04:24, 29 October 2016

mystring = 'cheetahs run real fast' print mystring.split()[2]

real

the [index] starts at zero