Programming basics Flashcards

1
Q

what is an integer

A

whole number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a float

A

decimals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is aboolean

A

true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is character

A

a single letter, number or symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a string

A

a collection of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is casting

A

changing the data type of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the symbol of power

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the symbol for DIV

A

//

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the symbol for MOD

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what does DIV do

A

returns how many times one number goes into another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what does MOD do

A

returns the remainder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the symbol for not equal to

A

!=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is constant

A

a variable that cannot be changed when a program is being run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how do you make a constant in Python

A

put “const” before the variable name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are the 2 types of loops

A

condition controlled loops
count controlled loops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are the 3 parts of the code

A

sequence
selection
iteration

17
Q

what is sequence

A

the order in which code is executed

18
Q

what is selection

A

a part of the program that makes a choice

19
Q

what is iteration

A

a loop

20
Q

what is an array

A

a list of values or data

21
Q

what are the 3 ways you can open a file

A

read
write
append

22
Q

what happens when you open a file as read

A

you can only read the data and cannot edit it

23
Q

what happens when you open a file and write

A

it will delete or the data on the file and write over it

24
Q

what happens when you open a file as an append

A

it will add data to end of the file

25
Q

what line of code is used to open a file

A

file = open(“file.txt”)

26
Q

what line is used to close a file

A

file.close()

27
Q

what line is used to read a line

A

file.readLine()

28
Q

what line is used to write a line

A

file.writeLine()

29
Q

what are the 3 parts of an SQL search

A

SELECT
FROM
WHERE

30
Q

what do you put in SELECT in SQL

A

what field you want

31
Q

what do you put in FROM in SQL

A

the name of the table

32
Q

what do you put in WHERE in SQL

A

the condition

33
Q

what are the 2 types of sub-programs

A

function
procedures

34
Q

what is the difference between a function and a procedure

A

a function returns a value

35
Q

what do you call a piece of data that a function will take in

A

parameter

36
Q

what are some benefits of subprograms

A

help organise data
efficient