Week 2 Ch2 Flashcards

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?

A

Parentheses

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
Q

Can you perform mathematical operations on strings?

A

No

26
Q

What does the plus operator + do?

A

It concatenates. Joins strings together.

27
Q

What are two statements?

A

Assignment and print

28
Q

Does the assignment statement produce an output

A

No it does not

29
Q

When the interpreter displays the value of an expression, what format does it use?

A

Uses same format you would use to enter a value.

30
Q

What will the print statement do with strings in quotation marks?

A

Display string without quotations.

31
Q

What are operators?

A

Special symbols that represent computations like addition

32
Q

What is this **?

A

Means exponentation

33
Q

What does the * operator do on strings?

A

It performs repetition. One of the operands has to be a string and the other has to be an integer.

34
Q

What is one of the most useful things about programming languages?

A

Ability to take small building blocks and compose them.

35
Q

Where can you put line # comments ?

A

At the start and end of a line

36
Q

Should comments be used to explain why you did something a certain way?

A

Yes they should