5/5
## Math in Python We can perform simple mathematical calculations in Python. Let's look at addition, subtraction, multiplication, and division. ### Addition ```python print("add") my_number = 5 + 5 print(my_number) ``` ### Subtraction ```python print("subtract") my_number = 5 - 5 print(my_number) ``` ### Multiplication ```python print("multiply") my_number = 5 * 5 print(my_number) ``` ### Division ```python print("divide") my_number = 7 / 2 print(my_number) ``` We can run the script and view the results.
We can perform simple mathematical calculations in Python. Let's look at addition, subtraction, multiplication, and division.
We can run the script and view the results.
A simple guide to basic math in Python - Learn how to use Python to perform common mathematical operations like addition, subtraction, multiplication, and division. The lesson covers variable assignment, basic operators, and the print function.
Previous lesson
Previous
Next lesson
Next
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on November 7, 2025
Duration: 2h 21min
Duration: 1h 51min
Duration: 59min
Duration: 2h 23min
Duration: 53min
Duration: 2h 25min
Duration: 29min
Duration: 1h 54min
Duration: 12min
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on November 7, 2025