Python Vocabulary Flashcards
argument
a piece of information that’s required by a function so it can preform it’s task. usually a string or numbers. example: my_function(argument here)
bug
a piece of code that is causing a program to fail
casting
the process of converting one data type into another. example: a number may be stored as text but needs to be an integer. it can be done like this: int(“3”)
commenting
text in a program that is for human readers. it is ignored by the computer when running the program. i’m python, all comments start with a hash symbol#
comparative operator
also called logic operators, they allow us to compare data in a program. they include == and >
constant
a number that does not change. it’s good practice to make them in capitals. example: SPEED_OF_LIGHT
data - type
different types of info stored by computer. example: floats, integers, and strings
default
a value given to an argument or variable as a starting point
equals operator
the equal sign is used to assign a value to a variable. example: n=2. this assigns the value 2 to variable n.
escape sequence
when characters that have certain meanings in python are required in strings they have to be “escaped” so the computer knows they do not have their usual meaning. this is done by putting a slash in front of them: \
execute
another word meaning run
float
a number data - type that can have a decimal value
function
a reusable piece of code
global variable
a variable that is useable anywhere in a program
hacking
taking some previously written code and rewriting parts to make it do something different
I D E
stands for Integrates Development Environment. I D L E is an example. they are special text editors with useful tools built in for programmers
I D L E
stands for Integrated DeveLopment Environment. this is the I D E that comes with python 3 install
infinite loop
a piece of code that runs forever. this is usually a bad thing
integer
a number data - type that cannot have a decimal value and must be a whole number
interactive mode
this is when we use I D L E to try out snippets of code without saving them
local variable
a variable that is defined inside a function and is only usable inside a function and is only usable inside that function
logical operator
they allow us to compare data in a program. they include == and >
also called comparative operator
loop
a piece of code that keeps repeating until a certain condition is met
mathematical operator
an operator that preforms some mathematical function on some numbers e.g. multiplication or addition
method
the name given to a function in a class
module
a saved python file whose functions can be used by another program
modulus
a mathematical operation that is used to return the remainder from a division calculation
operator
a symbol that performs a simple function on some code such as multiplying two numbers or comparing them to see if they are equal. see also comparative operator and mathematical operator
output
data that is sent from a program to a screen or printer etc.
return
- the value a function will produce after it has been run (it is also a python keyword) 2. the ‘end of line’ key on a keyboard, sometimes called the enter key
script mode
this is when we use I D L E to help us write code that we will save in a file
statement
a piece of code that represents a command or action e.g. a print statement
string
text data, which can be stored in a variable
syntax error
an error produced when a computer fails to run a program because it cannot recognize the format of the code supplied, e.g. a syntax error would be produced if a bracket had not been closed
tkinter
a package of classes that are often imported into python programs that give methods that are useful for producing windows, drawing images, and producing animation
variable
a name that refers to a place in a computer’s memory where data is stored. more loosely, it can also be used to refer to that data
while loop
a kind of loop that repeats code while a comparative statement returns TRUE