1/14
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Function
A self-contained block of code that performs a specific task, such as printing information.
Function Identifier
The name of the function, typically written in lowercase with underscores between words.
Argument
A value passed to a function within parentheses; may affect how the function behaves.
Return Value
The output that a function gives back after execution. Some functions may not return anything.
print() Function
A built-in function used to display text or data to the console or a file.
print()
objects Parameter
print() sep Parameter
Defines the separator between objects; default is a single space (' ').
print() end Parameter
Defines what’s printed at the end of the output; default is a newline character ('\n').
print() file Parameter
Specifies the destination file object; default is sys.stdout (the console).
print() flush Parameter
Boolean flag to determine whether to flush the output buffer immediately; default is False.
f-string
A formatted string literal in Python using f
before the string to embed expressions with {}
.
input() Function
A function that prompts the user to enter input from the keyboard; always returns a string.
input() Syntax
input(prompt: string) — displays a prompt and waits for user input.
Data Type of input()
Input received using input() is always treated as a string, even if it looks like a number.