Please, fix the indentation in your code - some times you have 1 space and some times - 2 spaces per level. Also use 4 spaces per indentation level, as per PEP8 recommendation. In any case using just one space per level makes it very hard to read your code.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs