The main difference between MicroPython and Python is that MicroPython is used for tiny hardwares, whereas Python is used for different types of software development.
Python runs on 64 bit operating system and uses heavy libraries/packages, which runs smoothly on Window/Linux/Mac operating system and execute many heavy machine learning algorithim and use powerful packages.
There are more than 80000 packages available for Python on the internet which serve different purposes and these packages consume a lot of space and resources of the hardware(hardware of Desktop/Workstation), whereas Micro Python does not support these packages and build for small packages, that is why Micro Python is developed for smaller hardware and compatible for low power of the hardware configuration.
Applications for Python : Desktop applications, web development, etc.
Applications for Micro Python : Internet of Things (IoT), embedded systems
Example: Python Program
Addition of numbers in Python
# Add Program in Python
# Function to add two numbers
def add_numbers(num1, num2):
return num1 + num2
# Get input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
# Call the add_numbers function and store the result
result = add_numbers(num1, num2)
# Print the result
print("The sum of", num1, "and", num2, "is:", result)
Example: microPython Program
# Add Program in MicroPython
# Function to add two numbers
def add_numbers(num1, num2):
return num1 + num2
# Get input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
# Call the add_numbers function and store the result
result = add_numbers(num1, num2)
# Print the result
print("The sum of", num1, "and", num2, "is:", result)
Note : program in python and micro python both are same