PYTHON_101 | WHY USE PYTHON
SMARS Learning Platform
15% Complete
PYTHON_101 | WHY USE PYTHON
Python code is easier to write, cleaner and clearer to read, and faster to get to the result you want.
Compare these two examples below. First is a piece of code written for the Arduino in C++:
#include “stdio.h”
void helloWorld() {
printf(“hello world”);
}
void main() {
helloWorld();
}
The second piece of code is written in Python:
def hello_world():
print(“hello world)
hello_world()
As you can see, the Python code is simpler, easier to read, shorter and faster to write.