Data Types Flashcards

1
Q

Integer

A

Used to store whole numbers e.g age or house number

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

Real/Float

A

Numbers with a decimal place e.g money (£2.45)

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

Boolean

A

TRUE/FALSE values (e.g 18+ in a voting program)

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

Character

A

Stores a single character e.g storing the input for a menu within a program (option A, B, C or D)

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

String

A

Used to store alphanumeric characters e.g the word “Programming”. Other examples include names or DOB with / to separate values

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

Casting

A

The process of changing a variable’s data type within a program.

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

Example of Casting -

A
  • age_integer = int(input(“Please enter your age - “))
  • print(age_integer + 5)
  • age_string = str(age_integer)
  • print(age_string + “5”)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly