Appendix 5d (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
15 cards from this deck
ShowHide
Practise the cards
15 cards from this deck
Operator for variable assignment
Operator for variable assignment
=
Keyword to declare a global variable
Keyword to declare a global variable
global
Functions to cast to string, integer, and float
Functions to cast to string, integer, and float
str(), int(), float()
Number of iterations: for i = 0 to 7
Number of iterations: for i = 0 to 7
8 times (0-7 inclusive)
What MOD operator returns
What MOD operator returns
Remainder after division
What DIV operator returns
What DIV operator returns
Quotient (whole number from division)
Three logical operators
Three logical operators
AND, OR, NOT
Operator to check equality
Operator to check equality
==
Get length of a string
Get length of a string
stringname.length
Extract part of a string
Extract part of a string
stringname.substring(startingPosition, numberOfCharacters)
Starting index position for strings
Starting index position for strings
0
Starting index for arrays
Starting index for arrays
0
Key difference: function vs procedure
Key difference: function vs procedure
Function returns a value, procedure doesn't
Methods to read from a file
Methods to read from a file
openRead(), readLine(), close()
Symbol for comments
Symbol for comments
//
