In [1]:
from __future__ import print_function
print('Hello World')
In [3]:
from __future__ import division
3 / 2
Out[3]:
In [5]:
s = "Hello World"
s
Out[5]:
In [6]:
# Let's try to change the first letter to 'x'
s[0] = 'x' # strings are immutable, i.e. cannot be chnage programatically
In [11]:
print("This is a tab \t Tab starts here") # in python 3 you need duoble quotes to have the special characters evaluated
In [12]:
s = 'Hello World!'
s[0]
Out[12]:
In [15]:
s[::2]
Out[15]:
In [21]:
s[6:7]
Out[21]:
In [16]:
s[::-1]
Out[16]:
In [22]:
s[:] # this means select everything
Out[22]:
In [25]:
s[1:10:3] # 1 up to 10 (not included) with incremental steps of 3
Out[25]:
In [ ]: