Upgrade and deploy using python 3.9

Question:
How to upgrade and deploy using python 3.9?
Repl link:

code snippet

Question:
By default, python 3.8 is the version used. How do I change that default to be python 3.9 and 3.10?
Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

code snippet