Help us help you. Read this link first and learn how to format code so we can help you better. Do not use a screen shot of your code as some of us will copy and paste the code to get it to work for you, so you can learn from this. About the Python Help category You will get more help this way.
Yes, I’ve found the Gemini AI is terrible at writing whole programs, so I just ask it to write sections of code, or just ask it how to do one step, and even then it often (about 50% of the time) uses outdated modules, or something else doesn’t work. That’s why I use a search engine to answer my programming questions because I can limit websites to the past year, and that works much better.
However there are VSC extensions that can write code for you. At least AICodeKing on Youtube says they are great but he only does really simple examples. He is reviewing VSC AI extensions almost daily.