Back to marketplace

2.2

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What is a variable?

Back (Answer)

• Value stored in memory that can change while the program is running

#2
Front (Question)

What is a constant?

Back (Answer)

• Value that does not change while the program is running • Assigned when the program is designed

#3
Front (Question)

What is assignment?

Back (Answer)

• Giving a variable/constant a value

#4
Front (Question)

What is casting?

Back (Answer)

• Converting a variable from one data type to another • integer/character/string/float/boolean

#5
Front (Question)

What is an input?

Back (Answer)

• Value read from an input device (e.g. keyboard)

#6
Front (Question)

What is an output?

Back (Answer)

• Data generated by the computer • Displayed to the user

#7
Front (Question)

What does ** mean?

Back (Answer)

• Exponential

#8
Front (Question)

What does % mean?

Back (Answer)

• Modulus (remainder)

#9
Front (Question)

What does // mean?

Back (Answer)

• Quotient

#10
Front (Question)

What are the boolean operators?

Back (Answer)

• AND: both must be true (D logic gate with two inputs one output) • OR: either must be true (fish/kite logic gate with two inputs one output) • NOT: false (triangle with tip pointing right at a small dot with one input one output)

#11
Front (Question)

Why is casting necessary?

Back (Answer)

• Softwares receive data in a format they are expecting • Manipulation of data

#12
Front (Question)

What are the 3 stages to writing data to a file?

Back (Answer)

• variable = open(‘filename.txt’, ‘a’) to append (OR to write do ‘w’) • variable.writeLines • \n = enter a new line • variable.close()

#13
Front (Question)

What are the 3 stages to reading data from a file?

Back (Answer)

• variable = open(‘filename.txt’, ‘r’) to read • variable2 = variable.readline() • print(variable2) • To read next line, just do another variable and do variable.readline() again

#14
Front (Question)

Why do you need to close a file?

Back (Answer)

• Releases the file handle and breaks the connection between it and program • variable.close()

#15
Front (Question)

What do you have to do once you have written to a file but want to read it (or vice versa)?

Back (Answer)

• variable = open(‘filename.txt’, ‘r’) to read • variable = open(‘filename.txt’, ‘a’) to append (OR to write do ‘w’) • MUST do before cause that is just file handling rule

#16
Front (Question)

SQL Commands

Back (Answer)

• SELECT: field to be returned (* = all) • FROM: which file • WHERE: certain condition (LIKE = wildcard) • ORDER BY: ASC or DESC

#17
Front (Question)

Explain the two main types of sub programs

Back (Answer)

• Procedures: carry out a task and provide structure to code (basically main.py) • Functions: carry out a task and return a value, creating reusable program components

#18
Front (Question)

What are the advantages of subroutines?

Back (Answer)

• Easier to write entire program (many can work on large program at the same time, cutting down development time) • Easier to debug (maintainability: can be tested separately) • Reusable components (could be gathered into library for use over multiple programs) • Good programming technique

#19
Front (Question)

What is a record?

Back (Answer)

• Collection of related data items for one entity (could be different data types)

#20
Front (Question)

What are records stored in text files?

Back (Answer)

• Stored on secondary storage • Used to store data when the application if closed • Each entry is on a new line • May require linear search to find data • Structure text files (e.g. CSV) can be used to exchange stored data between applications

#21
Front (Question)

What are records stored in arrays/lists?

Back (Answer)

• Stored in main memory (RAM) • Used to store data when program is running • Single/multi-dimensional • Indexes refer to data items • Efficient algorithms are used to find data

#22
Front (Question)

What is the difference between an array and list?

Back (Answer)

• Array: static data structure (1D) • List: dynamic data structure (2D)

#23
Front (Question)

What are the three basic programming constructs?

Back (Answer)

• Sequence: executing one instruction after another, one by one • Selection: a program branch depending on a condition (IF) • Iteration: repeating code in a loop (counter (FOR)/condition (WHILE)) until a condition has been satisfied

#24
Front (Question)

What are the advantages of local variables?

Back (Answer)

• Self-contained within subroutine, can be used without variable names conflicting with those used in main (if a local and global variable have the same name, the local variable takes priority within the function • Memory efficient: memory space is created when the subroutine is executing, it will be released when the execution is finished