środa, 2 października 2013

get the first half of the string - python

root::Lati { /tmp }-> python
Python 2.7.3 (default, Apr 10 2013, 06:20:15)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> book = "marek borkowski python tutorial"
>>> book[0:len(book)/2]
'marek borkowski'


Brak komentarzy:

Prześlij komentarz