What is: To join two operands end-to-end.
Give this one a try later!
concatenate
What output will the following Python statements produce?
>>> print (2*(3 - 1))
Select one:
a. 6
b. 5
c. 4
d. 3
Give this one a try later!
, c. 4
What is the output of the Python code below?
my_list = [3, 2, 1]
print(my_list.sort())
Select one:
a. 0
b. {1, 2, 3}
c. None
d. syntax error
e. [1, 2, 3]
Give this one a try later!
c. None
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text ">>>" called?
Select one:
a. a function
b. an operator
c. a prompt
d. a statement
e. a value
Give this one a try later!
, c.
a prompt
Assume that d is a Python dictionary. What does the following Python code produce?
result = dict()
for key in d:
val = d[key]
if val not in result:
result[val] = [key]
else:
result[val].append(key)
Select one:
a. a histogram
b. an inverted dictionary
c. a list of tuples
d. a lookup
e. a reverse lookup
Give this one a try later!
b. an inverted dictionary
What is the output of the following Python program?
fruit = "banana"
letter = fruit[1]
print (letter)
Select one:
a.b
b.a
c.n
d.banana
Give this one a try later!
, b.a
Which one of the following Python expressions generates a syntax error?
Select one:
a. 8 ^ 2
b. 8 ** 2
c. 8 +- 2
d. 8 += 2
e. 8 -+ 2
Give this one a try later!
d. 8 += 2
What is the output of the Python code below?
my_tup = (3, 2, 1, 2)
print(tuple(sorted(my_tup)))
Select one:
a.(1, 2, 3)
b.{1, 2, 2, 3}
c.(1, 2, 2, 3)
d.syntax error
e.[1, 2, 2, 3]
Give this one a try later!
c.(1, 2, 2, 3)
Give this one a try later!
concatenate
What output will the following Python statements produce?
>>> print (2*(3 - 1))
Select one:
a. 6
b. 5
c. 4
d. 3
Give this one a try later!
, c. 4
What is the output of the Python code below?
my_list = [3, 2, 1]
print(my_list.sort())
Select one:
a. 0
b. {1, 2, 3}
c. None
d. syntax error
e. [1, 2, 3]
Give this one a try later!
c. None
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text ">>>" called?
Select one:
a. a function
b. an operator
c. a prompt
d. a statement
e. a value
Give this one a try later!
, c.
a prompt
Assume that d is a Python dictionary. What does the following Python code produce?
result = dict()
for key in d:
val = d[key]
if val not in result:
result[val] = [key]
else:
result[val].append(key)
Select one:
a. a histogram
b. an inverted dictionary
c. a list of tuples
d. a lookup
e. a reverse lookup
Give this one a try later!
b. an inverted dictionary
What is the output of the following Python program?
fruit = "banana"
letter = fruit[1]
print (letter)
Select one:
a.b
b.a
c.n
d.banana
Give this one a try later!
, b.a
Which one of the following Python expressions generates a syntax error?
Select one:
a. 8 ^ 2
b. 8 ** 2
c. 8 +- 2
d. 8 += 2
e. 8 -+ 2
Give this one a try later!
d. 8 += 2
What is the output of the Python code below?
my_tup = (3, 2, 1, 2)
print(tuple(sorted(my_tup)))
Select one:
a.(1, 2, 3)
b.{1, 2, 2, 3}
c.(1, 2, 2, 3)
d.syntax error
e.[1, 2, 2, 3]
Give this one a try later!
c.(1, 2, 2, 3)