The general logic is the
same but the syntax is different. Libraries such as NumPy and
matplotlib provide Python with matrix operations and plotting.
See this reference on NumPy and info on matplotlib
(links open in new tab).

Python code

MATLAB
code

#
numeric variables

# are

double precision by
default

a =
5.0

% numeric variables

% are
double precision by default

a =
5.0;

#
repeat which assigns values to array elements

#
arrays are known as "lists" in Python
# array indexes start at 0 in Python

#
structures are defined by indentation, no 'end'

A =
[] # initialize array A
for i in range(1,11):
A.append(i)
print(A[i-1])