Programming Basics - Data Types Flashcards

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

5 main data types

A

Integer
Real
Boolean
Character
String

Using correct data types makes code more memory efficient, robust

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

Data type: Integer

A

Whole number
‘int’

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

Data type: Real

A

Decimals
‘real’

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

Data type: Boolean

A

Can take one of two values: e.g. true or false
‘bool’

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

Data type: Character

A

A single letter, character, symbol
‘char’

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

Data type: String

A

To represent text
‘string’

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

Size of integer

A

2 bytes

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

Size of real

A

4 bytes

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

Size of boolean

A

1 byte

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

Size of character

A

1 byte

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

Size of string

A

1 byte per character

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

Casting

A

Functions to manually convert between data types
e.g. int(), real(), bool(), str()

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