paper 2 section 8 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Variable

A

A labelled area of memory that can be changed by the program

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

Upper and Lower

A

.upper converts string to uppercase
.lower converts string to lowercase
sentence=”hello”
print(sentence.upper())

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

Text Files

A

To read a text file:
TextFile=open(“test.txt”, “r+”)
OpenText=TextFile.read()
TextFile.close()
print(OpenText)

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

Subprograms

A

Set of reusable code that has a set of instructions that is executed when called

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

SQL

A

SELECT - specifies which fields to include
FROM - which tables the fields will come from
WHERE - includes any criteria
ORDER BY - sorts the results
* - All

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

Sequencing

A

Putting instructions in order to perform a task.

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

Selection

A

Conditions used to decide whether code is executed.

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

Procedure

A

Doesn’t return a value
print()

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

Iteration

A

Repetition of code.

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

Indexes

A

Characters in string can be referenced by index
studentname=”Rina”
studentname[0] is R

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

Functions

A

Returns a value
def number():
result=2*2
return(result)

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

Database

A

A collection of records each having an identical record structure

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

Data Types - String

A

Several keyboard characters
Str

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

Data Types - Real/Float

A

A fraction/decimal
float

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

Data Types - Integer

A

A whole number
int

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

Data Types - Character

A

A single keyboard character
Char

17
Q

Data Types - Boolean

A

True or False
bool

18
Q

Assignment

A

Assigning a value to a variable.

19
Q

Arrays

A

Data structure of fixed length used to hold several items of the same data type
list=[“January”,”February”,”March”]
no=1
for x in list:
print(x, “Position:”,no)
no=no+1

20
Q

2D Arrays

A

Stores a table in python
For example:
[1,2,3,4,5],[6,7,8,9,10]