idk random

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

14 Terms

1
New cards

Don't Repeat Yourself (DRY)

A principle of software engineering aimed at making it easier to maintain, update, and debug code.

2
New cards

Functions

Named containers for statements that can be invoked to execute code, improving readability and reducing repetition.

3
New cards

Built-in functions

Functions like print(), len(), and type() that come with Python and can be called without being defined first.

4
New cards

Docstring

A string written on the first line of a function's body that describes what the function does, shown by help() and in VS Code.

5
New cards

Parameters

Placeholders for inputs given to the function that can change the function's behavior.

6
New cards

Arguments

The actual values provided when invoking a function.

7
New cards

Return statements

Allow functions to produce values for use elsewhere in the program and terminate function execution.

8
New cards

Default values

Parameters can have these, allowing flexibility in how functions are called.

9
New cards

Keyword arguments

Allow arguments to be passed by name instead of by position.

10
New cards

NameError

Raised when a line uses a name that does not exist, often due to misspelling or scope issues.

11
New cards

TypeError

Raised when a value is the wrong type for what is requested in the code, or when incorrect arguments are given to a function.

12
New cards

Scope

Determines where variables can be accessed; includes global and local scopes.

13
New cards

Global scope

The file outside of any function, where variables are reachable anywhere in that file.

14
New cards

Local scope

The inside of a function, where variables exist only while the function is running.