Question: I want to make a script which will type string letters one by one

```
def autotype(info):
    count = len(info) #Countign number of letters of the string
    splitlist = list(info) 
    i = int(count) #getting an error on this line! it accept i=int(0) but my loop doesnt work because of this
    while i>0:
        sys.stdout.write(splitlist[i])
        time.sleep(0.2)
        i -= 1

info = str("hello world")
autotype(info)

```

the error is: list index out of range
how do i fix it?

Answer: 
Your script is quite un-pythonic. Here is something that would do the same. Strings are iterables, so:

```
def autotype(info):
    for x in info:
        sys.stdout.write(x)
        sys.stdout.flush()  # you need this, because otherwise its' buffered!
        time.sleep(0.2)

```

That's all you need.
Unidiomatically, but concisely:

```
import time
import sys

autotype = lambda instr:map((lambda ch:(sys.stdout.write(ch), time.sleep(0.2))), instr)

autotype("hello world")

```

The main problem with the above code is that it's not usual to sequence two functions using tuple if you don't care for their return values.