Back to notes
Why is Python considered case sensitive?
Press to flip
Python is case sensitive, meaning it treats variables and identifiers with the same letters but different cases (e.g., 'Variable' and 'variable') as distinct.
What does it mean that Python is 'platform independent'?
Platform independence means Python code can run on different operating systems without needing modification, provided Python is installed on the system.
What makes Python a high-level programming language?
Python is considered high-level because it is designed to be easily readable and understandable by humans, using syntax and constructs that are more abstracted from machine language.
Describe 'script mode' in Python and how it differs from interactive mode.
In script mode, code is written in a file (a script) and executed all at once, unlike interactive mode where code is executed line-by-line.
Describe the use of 'assignment operators' in Python.
Assignment operators assign values to variables; 'a = 5' sets 5 into 'a', while compound operators like 'a += 5' add 5 to 'a's current value.
What are 'tokens' in Python, and what are some of its units?
Tokens are the smallest building blocks in Python, including keywords, identifiers, literals, etc. They create the structure of Python code.
Identify and give a brief description of Python's data types.
Python's data types include List (mutable sequence), Tuple (immutable sequence), Dictionary (key-value pairs), and Set (unordered collection of unique items).
What is the difference between a 'logic error' and a 'runtime error' in Python?
A logic error occurs when a program runs without crashing but produces incorrect results due to a flaw in the logic, whereas a runtime error occurs during code execution, causing the program to stop unexpectedly.
Explain the significance of Python being 'free and open source'.
Being free and open source means Python can be freely distributed and modified. Its source code is accessible to developers who can contribute to its improvement.
Provide an example of using 'interactive mode' in Python programming.
In interactive mode, you can enter expressions at the Python prompt (>>>), which are executed immediately, such as typing 'print("Hello, World!")' and seeing the output directly.
How is Python's character set relevant to its programming capability?
Python's character set includes letters, numbers, and symbols supported by ASCII and Unicode standards, allowing for a diverse range of textual data handling.
Explain the role of 'relational operators' in Python programming.
Relational operators, such as '==' and '!=', are used to compare values, returning a Boolean value indicating the relationship between the operands.
Differentiate between 'explicit' and 'implicit' type conversion in Python.
Explicit conversion is manually changing data type using functions like int(), float(), str(), while implicit conversion is automatically done by Python, without programmer intervention.
How does Python handle 'syntax errors'?
Python produces a syntax error when the parser detects incorrect syntax. It happens at the point of writing and stops code execution until resolved.
What is a 'logical operator', and how is it used in Python?
Logical operators 'and', 'or', 'not' are used to combine conditional statements, returning boolean results based on the logic they apply.
Previous
Next