Assignment operator
Python: =
Pseudocode:
Variables
Integer numberOfStudents Whole 2 bytes
numbers
Real circleArea Numbers 4 bytes
with a
fractional
part
Boolean found True or False 1 bit or 1
byte in
Higher Level
Languages
Char answer A single 1 Byte
ASCII
character
String studentName Zero or more 1 byte per
characters character
- Declaring a variable gets it ready for use in the program
- The data type is given to the variable
Examples:
DECLARE sidesInShape : INTEGER
DECLARE name : STRING
Name “Adithya”
Constants
CONSTANT Pi 3.1415926535
CONSTANT VAT 0.2
Words are separated by an underscore
- Declaring constants prevents the value from being changed
accidentally by a part of code
- It shows a programmer that the value should stay the same
throughout the program
- A constant cannot be changed when the program is running. It can
be changed before the program is compiled.
OUTPUT “How many hours a night do you sleep?”
^ is an exponent
(//)DIV is used for integer division, also known as quotient
(%)MOD returns the remainder after division
(**) Exponent in python
Function
LENGTH (String)
SUBSTRING(String, start, length)
LCASE (Str)
UCASE (Str)
PYTHON INDEXES START AT 0
PSEUDOCODE INDEXES START AT 1