IndexError: list index out of range
>>> l = [1,2]
>>> l[1]
2
>>> l[2]
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
IndexError: list index out of range
A simple print should tell you what is wrong print passWord
.
If it split at at :
,you will be able to call index 1 as shown in this example.
If not you get a IndexError.
>>> s = 'hello:world\n\r'
>>> s.split(':')
['hello', 'world\n\r']
>>> s.split(':')[1].strip()
'world'