★ Must-know
Guido van Rossum began developing Python in late 1989, naming it after the British comedy group Monty Python.
Python 0.9.0 included: functions, exception handling, lists, strings, dictionaries, modules
Python is:
Further detail
Python 1.0 was officially released in 1994 with functional tools such as map(), filter(), and reduce(), as well as modules, classes, and exception handling.
Python supports these programming paradigms:
Python can be extended with C or C++ code and is described as portable, integrated, easy to debug, and usable for frontend and backend development.
★ Must-know
Further detail
NumPy, pandas, and Matplotlib support data analysis and visualization, while TensorFlow and PyTorch are used for machine learning.
Django, Pyramid, and Flask are Python web application frameworks, and Python web applications can be hosted by Apache, IIS, and Nginx.
OpenCV, a C++ library ported to Python, is used for image processing tasks such as face detection and gesture recognition.
PyGame is used to build desktop and mobile games, and PyGame applications can also be installed on Android.
Python is used with Raspberry Pi and Arduino in embedded systems, automation, robotics, and IoT applications.
Python scripts can automate recurring tasks such as backups by scheduling them to run at predefined times.
Jython interacts with Java libraries and IronPython interacts with C#; Jython can use Java libraries such as Swing for rapid prototyping.
🔄 A REPL interaction proceeds by:
On Windows, typing python at the command prompt and pressing Enter opens the Python shell, whose prompt is >>>.
IDLE provides an interactive shell, a script editor with syntax highlighting, auto-completion and line numbers, and a debugger with breakpoints, stepping, and variable viewing.
IDLE runs on Windows, macOS, and Linux, and scripts can be run from its editor by pressing F5 or selecting Run Module.
REPL is the interactive prompt; IDLE adds an editor and debugger.
★ Must-know
A Python statement normally ends at a NEWLINE character, so each physical line is a separate statement unless line continuation is used.
A backslash joins physical lines into one logical statement, while a semicolon separates multiple statements written on one line.
A Python block starts after a colon, and all statements in the block must use consistent indentation; Python recommends four spaces and warns against mixing spaces and tabs.
Further detail
📌 Expressions inside parentheses, square brackets, or curly braces can span multiple lines without backslashes.
★ Must-know
📌 An identifier must start with a letter or underscore and may then contain letters, digits, or underscores; identifiers are case-sensitive and cannot be reserved keywords.
📌 The assignment operator = assigns a value to a variable, and Python supports both multiple-target assignment such as a, b = 1, 2 and chained assignment such as x = y = 0.
Further detail
Python naming conventions use: TitleCase for class names, lowercase with underscores for function names, lowercase with underscores for module names, uppercase for constants, double leading and trailing underscores for special names such as init
Python displays console output with print(), which supports f-strings, str.format(), percent formatting, and custom end and sep arguments.
★ Must-know
Further detail
Equality compares values; identity checks whether objects share the same memory location.
★ Must-know
Further detail
The left-shift operator << shifts bits left by inserting zeros on the right without dropping leftmost bits in Python, while the right-shift operator >> shifts right by copying the leftmost bit from the left and dropping rightmost bits.
For x = 5, x << 2 evaluates to 20 and x >> 2 evaluates to 1.
Take a 19-question practice quiz on Python Programming Fundamentals, with every answer explained.
1. Regarding Python’s origins, which statements are accurate?
2. Which areas are established applications of Python?
Memorize the key concepts of Python Programming Fundamentals with 66 flashcards.
When did Guido van Rossum begin developing Python?
In late 1989.
What inspired the name Python?
The British comedy group Monty Python.
When was Python 0.9.0 released?
February 1991.
Upload your class notes and Revizly writes a study guide, a quiz and flashcards in about a minute.
Study guide maker