Looks better now
Useless import and bad dictionary creation

That dictionary is faster (slightly) now and I find it more readable.
Typos, shadowing of str (built-in), useless imports