Week 2 Ch2 Flashcards

(36 cards)

1
Q

What is an integer value?

A

A number value

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

What is a floating point?

A

Decimal integer

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

What is a string value?

A

String of characters

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

In python strings belong to what type?

A

Str

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

In Python integers belong to what type?

A

Int

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

In python flouncing points belong to what type?

A

Float

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

If numbers are in quotation marks. are they still strings?

A

Yes they are considered strings in Python

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

What do commas do in Python?

A

Think it is a list of separated values

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

What is a variable?

A

Name that refers to a value

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

What is a common way to represent variables on paper?

A

Write the name with arrow pointing to variables value.

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

Type of a variable is the type of ______it refers to

A

Value

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

What do variable names have to begin with?

A

A letter

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

If you give a variable an illegal name what happens ?

A

Syntax error

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

Can variable names contain illegal characters?

A

No they cannot

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

Can variable names contain Python keywords?

A

No they cannot

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

What is a value?

A

Something a program manipulates

17
Q

What is an expression?

A

It is a combination of values, variables, and operators

18
Q

What is a statement?

A

Unit of code that Python interpreter can execute

19
Q

What is the difference between an expression and statement?

A

Expression has a value

20
Q

Order of evaluation depends on what?

A

Rules of precedence

21
Q

What has the highest precedence?

22
Q

What is after parentheses in the order of precedence?

A

It is exponents

23
Q

What precedence do multiplication and division have?

A

They have the same precedence

24
Q

Operators with the same precedence are evaluated in what order?

A

Left to right

25
Can you perform mathematical operations on strings?
No
26
What does the plus operator + do?
It concatenates. Joins strings together.
27
What are two statements?
Assignment and print
28
Does the assignment statement produce an output
No it does not
29
When the interpreter displays the value of an expression, what format does it use?
Uses same format you would use to enter a value.
30
What will the print statement do with strings in quotation marks?
Display string without quotations.
31
What are operators?
Special symbols that represent computations like addition
32
What is this **?
Means exponentation
33
What does the * operator do on strings?
It performs repetition. One of the operands has to be a string and the other has to be an integer.
34
What is one of the most useful things about programming languages?
Ability to take small building blocks and compose them.
35
Where can you put line # comments ?
At the start and end of a line
36
Should comments be used to explain why you did something a certain way?
Yes they should