Question 1 Output Print Tuple 2 Tuple Abcd 786 223 John 702 Abcd 786 223 John 702 Abcd 786 Q43836810
QUESTION 1
-
What is the output of print(tuple[2:]) if tuple = ( ‘abcd’, 786, 2.23, ‘john’, 70.2 )?
( ‘abcd’, 786 , 2.23, ‘john’, 70.2 )
abcd
(786, 2.23)
(2.23, ‘john’, 70.2)
1 points
QUESTION 2
-
What is the output of print(tuple[-3:]) if tuple = ( ‘abcd’, 786, 2.23, ‘john’, 70.2 )?
( ‘abcd’, 786 , 2.23, ‘john’, 70.2 )
abcd
(786, 2.23)
(2.23, ‘john’, 70.2)
1 points
QUESTION 3
-
when referencing the first index value within a list, inreference to the last element’s position, we begin with an indexof:
0
1
-1
any value
1 points
QUESTION 4
-
Dictionaries use what to uniquely identify each of itselements.
name
index
value
fractional index
1 points
QUESTION 5
-
unlike lists, a dictionary can only hold elements of the samedata type.
True
False
1 points
QUESTION 6
-
Dictionaries, while normally use names to reference an element,can also use index values.
True
False
1 points
QUESTION 7
-
When we want our program to re-cycle after each use, that is,continue running until the user chooses to stop, we use a:
for loop
while loop
do-while loop
switch statement
1 points
QUESTION 8
-
In OOP with Python, when a variable belongs to an object, werefer to it as a:
variable
attribute
field
object cannot contain variables.
1 points
QUESTION 9
-
In OOP with Python, when a function belongs to an object, werefer to it as a:
function
method
procedure
objects cannot contain functions.
1 points
QUESTION 10
-
When defining a class’s attributes, what does the doubleunderscore prefix mean?
the variable is static
the variable is private and cannot be seen by outside code
the variable is public and can be seen by outside code
the variable cannot be changed
Expert Answer
Answer to QUESTION 1 What is the output of print(tuple[2:]) if tuple = ( ‘abcd’, 786 , 2.23, ‘john’, 70.2 )? ( ‘abcd’, 786 , 2.23,…
OR