How to use Chess com API using Python Chess is an amazing strategy-based game and if you have been following the recent boom of online chess then welcome to the chess club. Online chess is amazing since it allows you to play with a random stranger at your level or stockfish (computer). There are many popular online chess websites like lichess.org, chess.com, playchess.com, and newly created kasparovchess.com. Today we will be seeing how to use chess.com API for getting players' stats. You can create software and get affiliates from them (check out the link below), so share it with them if you are planning to create something. Before you start make sure you have the following things: Pre-requirements Postman Anaconda or mini conda or Python idle Any text editor of your choice Pretty good? Now let’s download the JSON file that chess com developers have already made for us from here and then you import it to the Postman. This just helps you with prewritten get methods so that ...
A look into the pre-release in Python 3.10 Python 3.10 is around the corner and if you want to download the pre-release version of Python 3.10 then head to the link or check out the references at the end of the article. Photo by Clément Hélardot on Unsplash So, there are few new things added to Python, and if you want to check all of them out head to this link . But here are the two features that I really like: Structural Pattern Matching The match statement first evaluates the subject expression. If a comma is present a tuple is constructed using the standard rules. This has a similar structure as the switch case. This looks like a powerful tool when matching multiple values in an object or even a tuple. Fig.1. Simple example using match Let’s see a small example wherein you might need to retrieve 2 or 3 values based on input. The match pattern helps you to do that easily. Fig.2. Creating two classes Point3d and Point2d Let’s create a function that wi...