Chapter 2 Flashcards
(17 cards)
What is a Function (Procedure)?
A block of code you can run when needed
What does it mean to Call a function?
Use the function by writing its name
Define Parameter in the context of functions.
A name inside the function that holds input
What is an Argument?
The actual value you give when calling the function
What is Abstraction?
Hiding details to make code simpler
What is Modularity?
Breaking big problems into small parts
Define Algorithm.
Steps to solve a problem
What is an If Statement?
Runs code if a condition is true
What is Procedural Abstraction?
Using a function to hide code details
What does Return do in a function?
Sends a value back from a function
What is a Statement in programming?
A line of code that does something
Define Library.
A group of functions someone else made
What is an API (Application Programming Interface)?
Lets your code use tools from a library
Why use libraries?
They save time and give you ready-to-use code
Why is documentation important?
It tells you how to use the code
What does random.randint(a, b) do?
Picks a random number from a to b (including both)
Why use random?
For games, choices, or testing