python exam #2 2023 with 100% correct answers
Functions group of statements that exist within a program for the purpose of performing a specific task Divide and conquer Instead of writing 1 large program, break it down into individual tasks. individuals or teams can works independently on separate tasks. Advantages of divide and conquer Simpler for programmers code reuse better testing faster development void function executes statements, nothing is put into it by the program, and it sends nothing back to the main program value-returning function generate a value that is returned to the main program IPO input, processing, output local varaible anytime you assign a value to a variable inside a function parameter in the function, the variable that receives the argument Function header is the first, the commands are indented Global Variable Variable can be declared outside of all of the function block set of statements that belong together as a group scope the part of a program in which a variable is defined and may be accessed try suite and an except suite Instead of if statements, Python uses you don't have to say the path If the python program and the file you are reading are in the same folder
Información del documento
- Subido en
- 28 de julio de 2023
- Número de páginas
- 6
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas