Python is the undisputed language of Artificial Intelligence.
Why Python? It is simple to read, incredibly powerful, and has a massive ecosystem of AI tools. To the right, you'll see a fully functional Python environment running directly in your browser. No installation required.
The most basic command in Python is print(). It simply displays whatever you put inside the parentheses on the screen.
Try it out! Type the exact command above into the code editor on the right and hit the Run Code button.
In AI, we deal with massive amounts of data. We store this data in variables. Think of a variable as a labeled box that holds information.
At its core, Machine Learning is just a lot of math happening very quickly. Python makes this easy:
5 + 310 - 24 * 520 / 43 ** 2 (This is 3 squared)Imagine an AI model was tested on 1000 images and predicted 847 of them correctly.
correct and set it to 847.total and set it to 1000.print() the result.Hint: Divide correct by total, then multiply by 100.