print 1 word of string in python

From thelinuxwiki
Revision as of 04:24, 29 October 2016 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

real

the [index] starts at zero