Programing - General Flashcards
What is a variable?
An empty area where data can be stored, Variables are named.
What is a constant?
A constant is like a variable, but its contents cannot be changed during use.
What is an arithmetic Operator?
An symbol used in arithmetic, such as + or -.
What is assignment?
Assignment is when data is assigned to a variable or constant.
What is a condition controlled loop?
A condition controlled loop is a function which loops code as long as a set condition is met.
What is a count controlled loop?
A count controlled loop is a function which loops code a set number of times.
What is sequencing?
Putting code in the correct order.
What is selection?
When a choice is offered (often using IF statements).
What is iteration?
The looping of instructions.
what do these operators do? * MOD DIV \+ - ^ == != < <= > >=
* - Multiplication MOD - remainder from a division DIV - Divide, no remainder \+ - add - - subtract ^ - to the power of == - equal to != - not equal to < - less than <= - less than or equal to > - more than >= - more than or equal to
What are these data types?
Integer -
Real -
Boolean -
Character -
String -
Data types
Integer - A number with no fraction or decimal place.
Real - all numbers, basically. often written as ‘float’.
Boolean - Can only have 1 of 2 values, True or False.
Character - Stores a single leter, number, or symbol.
String - holds a list of characters any length. usually represented as “[text here]”.
what types of iteration are there?
Count controlled - Runs a specified number of times, an example would be: for i in range(0,5):
Condition controlled - Runs only as long as a specific condition id met. An example would be: While var1 > var2.
What operation is used to create a function/procedure?
‘def’ is used to create a function/procedure. an example would be: def AreaOfTriangle(a,b):