1. Pseudocode for maths
Pseudocode is known as Structured English.
Pseudocode is a way of writing a program that generalizes it for conversion into a programming language.
Pseudocode represents the the steps of the program in natural language and mathematical notation.
Pseudocode describes the logic of the program or algorithm.
For maths in Victoria, the convention is to use the keywords in bold lowercase.
1.1. Python to Pseudocode Summary
Pseudocode typically starts with begin and ends with end.
The table below has the typical pseudocode for common keywords and operators in python.
The quoted text in the python is not python. It is there to indicate the purpose.
Python |
Pseudocode |
---|---|
== |
= |
= |
← |
output or print or display |
|
input |
input or get |
if |
if … then |
elif |
elseif … then |
else |
else |
“end of if” |
endif |
for |
for |
“end of for” |
endfor |
while |
while |
“end of while” |
endwhile |
def |
function |
“end of def” |
endfunction |
return |
return |
or |
or |
and |
and |
not |
not |
True |
true |
False |
false |
try |
try |
except |
except |
pass |
pass |
class |
class |
“end of class” |
endclass |
import |
import |
open “a file” |
open |
read “a file” |
read |
write “to a file” |
write |