Learn to Code via Tutorials on Repl.it!

← Back to all posts
Python 3.10 on replit
19ecal

Basically put this in your .replit file:

Explanation:
(python3.10 --version || install-pkg python3.10): check the version of python3.10, if it exited non-zero install it
clear && python3.10 main.py: clear the screen and run main.py

Python 3.10 is not the full release until October (currently beta), and I doubt very much that replit will add it then, so use this .replit file if you want to run the new features.

https://docs.python.org/3.10/whatsnew/3.10.html

Voters
19ecal
Comments
hotnewtop
AdolfoBerge

The example you provided can already be emulated via dictionaries, but the upcoming match allows for much more precise control of the "keys".

http_code = "418"
result = {
"200": lambda: print("OK") or do_something_good(),
"404": lambda: print("Not Found") or do_something_bad(),
"418": lambda: print("I'm a teapot") or make_coffee(),
}.get(http_code, lambda: print("Code not found"))()

https://www.myccpay.pro/

ch1ck3n

why do you need python 3.10

IMayBeMe

@ch1ck3n idk, I guess it’s for people to feel like they use the latest tech hence making them a better programmer somehow. Tbh every python version is practically the same.