1/49
These flashcards cover key concepts from the lecture notes on computer programming and the science of computing, focusing on machine language, programming languages, compilation vs interpretation, Python programming, and fundamental programming concepts.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is machine language?
A set of specific instructions directly executable by a computer made up of binary digits.
What is assembly language?
A mapping of machine code instructions to mnemonics for better readability.
Define programming language.
A precisely constructed language specifically used to communicate instructions to a computer.
Why are programming languages more structured than spoken languages?
Programming languages are defined by rules, allowing for precise and unambiguous instructions.
What role does a compiler serve in programming?
It translates algorithms from a programming language into machine language.
Describe the process of compilation.
Converts programming language to assembly language, followed by linking to machine language.
What is an interpreter?
A tool that evaluates instructions in a programming language as the program is executed.
How does an interpreted language differ from a compiled language?
Interpreted languages are executed one instruction at a time, often leading to slower execution.
What are examples of interpreted languages?
Python, PHP, JavaScript, and Perl.
Define hybrid language.
A programming language that is compiled down to an intermediate language and then interpreted.
What is the difference between a function and a method in programming?
A method performs an action, while a function returns a value to the caller.
What is the Zen of Python?
A set of guiding principles for writing computer programs in Python emphasizing clarity and simplicity.
What is an Integrated Development Environment (IDE)?
A software providing tools for designing, executing, and debugging computer programs.
What does IDLE stand for?
Integrated Development and Learning Environment, specifically for Python.
Describe the difference between Scratch and Python.
Scratch is an educational tool designed to simplify programming concepts, while Python is a general-purpose programming language.
Why is Python chosen for general-purpose programming?
It allows for powerful programming with limited syntax knowledge, focusing on problem-solving.
What does the term algorithm refer to in computing?
A step-by-step procedure for solving a problem.
What is the purpose of a while loop in programming?
To execute a block of code repeatedly while a specified condition is true.
What is recursion in programming?
A technique where a function calls itself to solve a problem.
What are the three primary control constructs in programming?
Sequence, selection, and repetition.
What is a variable in programming?
A named object that can store a value of a particular data type.
How do you create a function in Python?
Using the 'def' keyword followed by the function name and parameters.
Define constant in programming.
A value of a particular type that does not change over time.
What is the use of the return keyword in a function?
To return a value to the caller from the function.
What is input/output (I/O) in programming?
The process of a program communicating with the outside world.
What is a data type?
The kind of value that can be expressed in a programming language.
Name one Python numeric data type.
int or float.
What is the purpose of indentation in Python?
To define the scope of loops, functions, and conditionals.
Explain the concept of debugging.
The process of identifying and resolving errors in a program.
What is an arithmetic operator?
Operators used to perform arithmetic operations on two operands.
State the purpose of relational operators.
To compare the values of two operands and evaluate to true or false.
What is a comment in programming?
Text in the code that provides information and is not executed.
How do you denote a single-line comment in Python?
Using the hash mark (#).
What are multi-line comments in Python?
Comments that span multiple lines, enclosed in triple quotes.
What does the term 'function call' mean?
Invoking a function to execute its code with specified parameters.
What is significant about the 'main' function in Python?
It is typically the entry point from where execution starts.
Explain what 'variable scope' is.
The context within which a variable is accessible or usable in a program.
What does it mean to declare a variable?
To define its name and, optionally, its type before use.
What are libraries in programming?
Collections of functions and routines for common programming tasks.
What is the difference between arguments and parameters?
Parameters are variables in a function definition, while arguments are the actual values passed to the function.
Define the term 'identifier' in programming.
A name used to identify a variable, function, or other elements.
What is the significance of reserved words in programming?
They cannot be used as identifiers because they have special meaning in the programming language.
How does Python handle errors during execution?
By raising exceptions to signal an error condition.
What is the purpose of Boolean expressions?
To evaluate to true or false, often used in control structures like if statements.
Describe a software library.
A collection of predetermined functions for solving common problems.
What is the print function used for in Python?
To display output to the console.
What is the role of the input function?
To obtain user input from the console.
Differentiate between an interpreted and a compiled language.
Interpreted languages execute code line-by-line, while compiled languages translate entire code into machine language before execution.
Why is context important in programming languages?
Context helps disambiguate instructions, ensuring proper interpretation by the computer.
What are programming paradigms?
Categories that describe how programming languages support certain features and styles.