Functions and parameters flashcards
Learn about functions and parameters in programming with these flashcards and quizzes.
Quiz(15 questions)
1. What is the purpose of a function?
Termes dans ce set(21)
What is a function?
A block of code that performs a specific task.
Define parameters.
Variables used to pass information into functions.
Difference between arguments and parameters?
Parameters are placeholders; arguments are actual values passed.
True or false: Functions can return values.
True, because functions can send back results to the caller.
What is a return statement?
Used to end a function and send a value back to its caller.
Fill in the blank: A function must be ______ before it can be called.
defined
What are local variables?
Variables defined within a function, inaccessible outside of it.
True or false: Functions can modify global variables.
True, if declared global inside the function.
What is a function signature?
The combination of a function's name and its parameters.
Define a void function.
A function that does not return a value.
Question: Can a function call itself?
Yes, this is known as recursion.
Difference between built-in and user-defined functions?
Built-in functions are provided by the programming language; user-defined are created by developers.
Give an example of a function call.
myFunction(arg1, arg2);
True or false: Functions can take multiple parameters.
True, functions can accept as many parameters as needed.
What is scope in programming?
The context in which variables can be accessed.
What does it mean to 'call' a function?
To execute the code contained within the function.
Fill in the blank: A function can be called ______ times.
multiple
What do you use to define a function in Python?
The 'def' keyword.
What is an anonymous function?
A function that is defined without a name, often used for short tasks.
How to pass default parameters?
By assigning a default value in the function definition.
True or false: Parameters can have different types.
True, parameters can be of various data types.
Questions dans ce set(15)
1. What is the purpose of a function?
2. Which of the following is NOT a type of function?
3. What keyword is used to define a function in JavaScript?
4. What does a return statement do?
5. What is the scope of a local variable?
6. Which of the following describes recursion?
7. What will happen if a function has no return statement?
8. What are default parameters?
9. What is a common use of lambda functions?
10. Which statement about parameters is correct?
11. What happens if you try to use a local variable outside its function?
12. How can you modify a global variable inside a function?
13. What is an argument in the context of functions?
14. Which of the following is a benefit of using functions?
15. What will happen if you skip giving an argument for a parameter with no default value?
Sets associés
Schleife Alltag Beispiel Begriffe
Abitur Datenbanken SELECT grob Prüfung
Wiederholung: Abitur Sortierverfahren
Abitur: Abitur Klassen und Objekte
Abitur Arrays
Abitur Rekursion
Debugging Schritt für Schritt
Bedingung Alltag Beispiel
Créez votre propre set d'étude
Téléchargez un PDF, collez vos notes ou décrivez un sujet – l'IA génère des fiches, des quiz et plus en quelques secondes.

