1/62
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
displays whatever is the the ()’s
+
puts words together with no space
,
puts the words together with a space
variables
containers that hold data, must declare by giving it a name
string(str)
text
integer(int)
integers, whole number
float(float)
decimals
boolean(bool)
true/false
casting
tell the computer to treat one variable like a different type, use to change a number into a string for printing, or change a string to a number
input
accepts data from the user, returns what the user enters, so you need to assign it to a variable
a + b = 40
addition
a- b = 6
subtraction
a * b = 391
multiplication
a/b = 1.35294
division
a % b = 6
modulus, remainder after dividing
a ** b = 14105
exponentiation/ power
a // b = 1
floor division, how many times a number can go into a number
a (2) + b(happy) = 2happy
concatenation
b(happy) * c(3) = happyhappyhappy
repetition
a==b is false
equality
a !=b is true
inequality
a>b is true
greater than
a<b is false
less than
a>= b is true
greater than or equal to
a<=b is false
less than or equal to
a=b
assigns b to a
a += b
increments a bt b (same as a = a + b)
a -=b
decrements a by b (same as a = a - b)
a*=b
multiplies a by b and stores the result in a (same as a =a*b)
a/=b
divides a by b and stores the result in a (same as a = a/b)
a % = b
divides a by b and stores the remainder in a (same as a = a%b)
a **=b
raises a to the power b and stores the results in a (same as a=a**b)
a//=b
divides a by b and stores the floor of the result to a (same as a//b)
selection (conditionals)
executres one or more statements only if a certain condition is met
iteration
repeats one or more statements until a certain condition is met
nest
putting one inside another
stack
putting one below another
elif(else,if)
when you have more than two conditions, the first one gets an if, the last one gets an else, and the middle ones get elif
event control
repeat until a certain event occurs
count control
repeat a specific number of times
while
loops repeat indented statements for as long as the condition is true
for-in loop
iterates over a list or collection of things, useful for going through strings
subroutine
a program inside of a program, helps us organize our code and gives us stuff we can re-use
procedure
a subroutine that performs actions then returns to the point where it was called
function
a subroutine that performs an action and returns a value to the point where it was called
parameters
variables inside of a function’s ()’s
return
statements with a variable or value after them send the information back to where it was called
scope
variables made inside of a function cannot be seen outside of it
default values
parameters inside a subroutine can be defined to defaults values, will allow us to invoke the same subroutine in multiple ways
library
collection of pre-written and tested subroutines
decomposition
breaking down a large problem into smaller easier parts
abstraction
using patterns and creating a generalized solution
algorithm design
creating a plan that will implement a solution
debugging
improving the solution
algorithm
detailed sequence of steps that describes how to solve a problem or accomplish some task
problem statement
formal way to define the problem
flowcharts
diagrams that represent a workflow or a process, direction of execution is shown by arrows, different shaped blocks stand for different kinds of step
terminal block
oval, shows the start or end of the algorithm
process block
rectangle, contains one statement in which some action is performed
input/ output block
parallelogram, shows when data is entering/ leaving the algorithm
decision block
diamond, asks a question, only block that must have more than one path leading from it
loop
repetition in programming
pseudocode
used to represent programmer languages, uses structural conventions of a programming language