© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. DanialPython for MATLAB Developmenthttps://doi.org/10.1007/978-1-4842-7223-7_3

3. Language Basics

Albert Danial1  
(1)
Redondo Beach, CA, USA
 

The fundamental elements of the Python language—variable assignment, indentation, array indexing, for and while loops, if statements, functions, comments, exceptions, modules—are covered in this chapter. Although classes and object-oriented programming are also fundamental aspects of Python, these will be covered in Chapter 10.

3.1 Assignment

Python supports four forms of variable assignment: conventional, conditional, in-place, and the recently added “walrus operator.”

3.1.1 Assignment with =

Variable assignment in both ...

Get Python for MATLAB Development: Extend MATLAB with 300,000+ Modules from the Python Package Index now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.