stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Module 2 IP Flashcards | StudBud
Explore
/
Module 2 IP
Module 2 IP
83 terms
·
StudBud Administration
·
2 plays
Imported from external platform
Flashcards
83 cards
F
Practice quiz
P
Host live
L
Questions
83
Answers
1
Strings 'str' are enclosed in quotation marks. "Hello, World!"
False
True
2
____ gives value to a variable
assignment statement
variable
3
Commas between integers is legal in Python >>> 10,000
False
True
4
>>> int(3.14)
3
3.14
3.0
5
____ turns its argument into a string
str function
float function
int function
6
>>> "15" + 2 will show an error message: # error
True
False
7
_______ binds a NAME, on the left-hand side of the operator to a VALUE
assignment token
assignment statement
8
commas between integers is illegal in Python and is a semantic error
True
False
9
Strings (str) are not enclosed in quotation marks
True
False
10
statements produce a result
False
True
11
Find the variable in Example: x = 7
=
x
7
12
A fundamental thing represented by a letter or # that the program manipulates
Value
Variable
13
>>> int(-3.999)
3
-3.999
3.999
-3
14
"Bruce's beard" is an example of a:
double quote
triple quote
single quote
15
what class does value "3.2" belong to? reminder- pay attention to quotations..
<class 'float'>
<class 'int'>
<class 'str'>
16
strings belong to class ___, can be single, double, or triple quotes
str
float
int
17
Two types of values
classes
data types
18
expressions can appear on the ___ hand side of the assignment statements
left
right
19
"76 trombones" is a correct variable
True
False
20
examples of statements
if
while
for
import
21
my_name is a correct variable
True
False
22
>>> 7 / 4
1
1.75
23
+ operator works with strings if + operator represents _____
addition
operands
concatenation
24
Example: >>> n = 17 what is n assigned to?
17
=
25
operators with the same precedence are evaluated from left-to-right (6-3+2) answer is ___
5
1
26
Example: >>> message = "What's up, Doc?" what is the variable?
"What's up, Doc?"
=
message
27
____ converts floating number or string and turn into an int by discarding a decimal
int function
str function
float function
28
single quotes can have double quotes inside them
True
False
29
what class does value "17" belong to?
<class 'float'>
<class 'int'>
<class 'str'>
30
___ is a combination of values, variables, operators, and calls to functions
expression
statement
31
____ values the operator uses
variable
operand
expression
32
>>> class = "Computer Science" will produce a correct variable
True
False
33
expressions produce results
True
False
34
>>> "15" + 2 will perform a math function
False
True
35
example of a string
>>> 'this is a string'
>>> “””And so is this.”””
>>> (this is a string)
>>> (13 + 4)
36
Operators with the SAME precedence are evaluated from right to left
False
True
37
variable representing "day" of the month
>>> "21"
>>> day = "Thursday"
>>> day = "Friday"
38
17 = n is a proper form of assignment statement
True
False
39
order of operation depends on the rules of precedence when more than one operator appears in an expression (PEMDAS)
False
True
40
what class does this value fall into? >>> type("hello, world!")
<class 'float'>
<class 'str'>
<class 'int'>
41
____ is "a variable's state of mind" aka represented variables with an arrow -->
state snapshot
assignment token
underscore character
assignment statement
42
Python keywords: define the language's syntax rules and structure, and cannot be variable names
False
True
43
17 = n is a syntax error, and is NOT a correct representation of assignment statement
False
True
44
____ are special tokens that represent computations lie addition, multiplication, and division
operators
operands
45
Variables and their meanings can change over time
True
False
46
dividing 0 with / or // will give you an exception (runtime error)
False
True
47
strings enclosed with 3 occurrences of either quote symbol are called ____ and can contain single or double quotes
triple quote
single quote
double quote
48
Find the integer in Example: x = 7
7
x
=
49
a value by itself is not a simple expression
False
True
50
commas between integers creates a PAIR in Python. example: >>> 10,000 creates what pair?
(10,0)
(10,00)
51
Variables can contain both letters and digits
True
False
52
Python is case sensitive so "Number" and "number" are different
True
False
53
you must write an ASSIGNMENT STATEMENT to give variable the VALUE you want it to have
False
True
54
Python has 30+ keywords: and, def, CLASS, in, is, try, none, or, with etc.
False
True
55
Example: >>> n = 17 what does (=) mean
assignment statement
assignment token
56
_____ uses token // and the result is always a whole number
floating point
floor division
57
double quotes can contain single quotes inside them
True
False
58
____ is a name that refers to a value
assignment statement
variable
59
Concatenation is the joining of two operands by linking them end-to-end
False
True
60
an operator with two operands is known as a __
hexadecimal operator
primary operator
binary operator
non-binary operator
61
>>> float(17)
17.0
17
62
Variables have to begin with a letter or an underscore
False
True
63
>>> str(17)
17
'17'
64
____ is instruction that the python interpreter can execute
expression
operands
statement
operators
65
Find the addition operator in Example: x + y
y
+
x
66
what class does >>> type(3.2) belong to?
<class 'int'>
<class 'float'>
<class 'str'>
67
integers belong to class ___
float
int
str
68
>>> 7 // 4
1
1.75
69
what class does this value fall into? >>> type(17)
<class 'float'>
<class 'str'>
<class 'int'>
70
Python is not case sensitive
True
False
71
in Python the ____ always yields the FLOATING point result (decimal)
//
/
72
Example of key words used in python
True
False
73
>>> int(minutes / 60)
10.4
10
74
you can divide 0 with / or //
True
False
75
you CANNOT perform mathematical operations on strings, even if strings look like numbers
False
True
76
'The knights who say "Ni!"' is an example of
double quote
single quote
triple quote
77
you CAN perform mathematical operations on strings, even if strings look like numbers
False
True
78
Bruce and bruce are NOT different variables
True
False
79
When a variable name appears in the place of an operand, it is replaced with its value before the operation is performed
False
True
80
a variable by itself is a simple expression
True
False
81
numbers with a decimal belong to ___ because these numbers are represented in a format called floating-point
str
float
int
82
___ can turn an integer or string into a float
int function
string function
float function
83
Example: >>> message = "What's up, Doc?" what is the string value?
=
"What's up, Doc?"
message