03 . Perform Operations using Data Types and Operations 1 - EXAM Flashcards
Which is true of variables?
Choose three answers.
a. Variables must include punctuation marks to signify new words
b. Variables must include at least one number
c. Variables are case-sensitive
d. Variables cannot begin with a number
e. Variables cannot have spaces in their names
c. Variables are case-sensitive
d. Variables cannot begin with a number
e. Variables cannot have spaces in their names
Which type of variable (data type) uses decimals?
Select one:
a. Integer
b. Float
c. Boolean
d. String
b. Float
Which comparison operator asks whether one value is equal to another?
Select one:
a. <=
b. >=
c. ==
d. =
e. /=
c. ==
Which symbol represents multiplication in arithmetic operators?
Select one:
a. /
b. +
c. *
d. .
e. x
c. *
Which first name variable is an example of camel casing?
Select one:
a. first Name
b. first.name
c. first_name
d. firstName
e. firstname
d. firstName
Which is the symbol that can concatenate appropriate variables in Python programming?
Select one:
a. *
b. @
c. &
d. ,
e. +
e. +
Which punctuation symbol should be used to combine strings and numbers in a print statement?
Select one:
a. ,
b. @
c. ()
d. &
e. +
a. ,
Given the following code:
north = 200 south = 300 northwins = north \> south southwins = south \> north print("Northwins = ", northwins, "Southwins = ", southwins)
Which type of data is displayed along with the string literals in the print statement?
Select one:
a. Float
b. String
c. Integer
d. Booleen
e. Tuple
d. Booleen
Given the following code:
price = 3.95
widgets = 5
print(“The price of the widget is “, price) print(“We have “ + widgets + “ in stock.”)
Which built-in function should be wrapped around the variable ‘widgets’, to cast it into a string variable?
Select one:
a. string
b. str
c. cast/str
d. stringtype
b. str
Given the code below, which number will the price variable show on the last line?
price = 3.95
widgets = 5
print(“The price of the widget is “, price)
print(“We have “ + str(widgets) + “ in stock”)
print(price * widgets) print(int(price), float(widgets))
Select one:
a. 4
b. 5
c. 3.95
d. 3
d. 3
Is the following statement true or false?
The term list is a data type (variable) which stores multiple values.
Select one:
a. true
b. false
a. true
Given the following code, which number is item East in the displayed list?
regions = [“North”, “South”, “East”, West”]
sales = [30000, 20000, 40000, 35000]
employees = [“Alice”, “Vera”, “Flo”, “Mel”]
print(“Region: “, regions[0], “Sales: “, sales[0])
Select one:
a. 2
b. 1
c. 4
d. 3
a. 2
Given that items on the same level/line are evaluated from left to right, what is the correct order of operations?
Select one:
a. Addition, Subtraction,
Exponents,
Parentheses,
Multiplication, Division
b. Parentheses,
Exponents,
Addition, Subtraction,
Multiplication, Division
c. Exponents,
Parentheses,
Addition, Subtraction,
Multiplication, Division
d. Parentheses,
Exponents,
Multiplication,
Division,
Addition,
Subtraction
e. Parentheses,
Exponents,
Multiplication, Division,
Addition, Subtraction
e. Parentheses,
Exponents,
Multiplication, Division,
Addition, Subtraction