Section 1 Chapter 1 - Programming Basics Flashcards
What is an algorithm
A sequence of steps that can be followed to complete a task and that always terminates
What is pseudocode
A tool for developing programs which is halfway between English and program statements. There are no concrete rules or syntax for how it is to be written
Integer
A whole number
Real / Float
A number with a fractional part
Boolean
A variable that can be either true or false
Character
A letter, number or special character typically represented with ASCII
String
A sequence of characters
Syntax to round n
round(n, decimalPlaces)
Syntax for exponentiation
a**b
Syntax for integer division
a div b
Syntax for modulo
a mod b
Syntax for finding length of string
len(string)
Syntax for getting the index of a substring in a string
string.find(substring)
Syntax for getting the integer (ASCII) value of a character
ord(char)
Syntax for getting the character represented by an integer
chr(integer)