Chapter 1 - Data Types Flashcards

1
Q

What is a string

A

A string is simply one or more characters enclosed in qoute marks

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

What symbol joins two or more strings together

A

+

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

If a number is in quotation marks is it still a number?

A

no it behave as a strings

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

What is a integer?

A

a whole number

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

what is a floating point?

A

a number with a decimal point

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

What are the maths symbols in python?

A

+ = addition
- = subtraction
* = multiplication
** = for exponentiation (squared e.g 2**3 = 8)

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

What does % and // also mean?

A

% = returns the remainder when one integer is divided by another (for example 19/5 = 3.8 but using a % would round it up to 4 automatically)
// = performs integer division getting rid of any remainders without rounding. (For example 19/5 = 3.8 but using // would display it as 3)

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

What is the round function and what does it do?

A
  • round()
    put round( then the result you want to round , the number of decimals you want)
    for example:
    result = 12.34343
    round(result,2)
  • 12.34
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are boolean data type?

A

is a data type that one of two possible values

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

What are the relational and logical operators?

A

less than: <
greater than: >
less than or equal: <=
greater than equal: >=
equal: ==
not equal: !=
logical and: and
logical or: or
logical not: not

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

what are objects in python?

A

strings, integers and floating points

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

What are assignment statement?

A

names are assigned to objects

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

What should you be aware when naming variables?

A
  1. they are case-sensitive so AverageMark is different averageMark
  2. Don’t make the name too long
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the print statement do?

A

Display text and data on the screen

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

What is a escape sequences?

A

Escape sequences allow you to put special characters such as newline or tab into your strings

16
Q
A