Question
A data type in which the values are made up of components, or elements, that are themselves values is known as an object data type.
A data type in which the values are made up of components, or elements, that are themselves values is known as an object data type.
Select one:
True
False
Question 2
Not yet answered
Marked out of 1.00
Flag question
Question text
Given any real numbers a and b, exactly one of the following relations holds: a < b, a > b, or a = b. Thus when you can establish that two of the relations are false, you can assume the remaining one is true. This principle is known as:
Select one:
a. trichotomy
b. abstraction
c. the distributive property
d. the transitive property
Question 3
Not yet answered
Marked out of 1.00
Flag question
Question text
Given the following code what will the output be? def find(strng, ch): index = 0 while index < len(strng): if strng[index] == ch: return index index += 1 return -1 print (find("the doctor is in", '*'))
Select one:
a. -1
b. 0
c. 12
d. 13
Question 4
Not yet answered
Marked out of 1.00
Flag question
Question text
Given the following code, what will the output be? import string index = "Ability is a poor man's wealth".find("w") print(index)
Select one:
a. 24
b. 0
c. 23
d. -1
Question 5
Not yet answered
Marked out of 1.00
Flag question
Question text
: A parameter written in a function header with an assignment to a default value which it will receive if no corresponding argument is given for it in the function call is called an optional parameter.
Select one:
True
False
Question 6
Not yet answered
Marked out of 1.00
Flag question
Question text
What output will the following code produce? print ("%s %d %f" % (5, 5, 5))
Select one:
a. 5 5 5.000000
b. 5 5 5
c. 5 5.000000
d. 0 5 5.0
Question 7
Not yet answered
Marked out of 1.00
Flag question
Question text
: To create a new object that has the same value as an existing object is know as creating an alias.
Select one:
True
False
Question 8
Not yet answered
Marked out of 1.00
Flag question
Question text
What output will the following code produce? mylist = [ [2,4,1], [1,2,3], [2,3,5] ] a=0 b=0 total = 0 while a <= 2: while b < 2: total += mylist[a][b] b += 1 a += 1 b = 0 print (total)
Select one:
a. 14
b. 23
c. 0
d. 13
Question 9
Not yet answered
Marked out of 1.00
Flag question
Question text
: The following code: for fruit in ["banana", "apple", "quince"]: print (fruit) will produce the following output: banana apple quince
Select one:
True
False
Question 10
Not yet answered
Marked out of 1.00
Flag question
Question text
Given the following code, what will the output be? mylist = ["now", "four", "is", "score", "the", "and seven", "time", "years", "for"] a=0 while a < 7: print (mylist[a],) a += 2
Select one:
a. now is the time
b. now is the time for
c. for score and seven years
d. now four is score the and seven time years for
Question 11
Not yet answered
Marked out of 1.00
Flag question
Question text
The output of the following code will be: fruit = "banana" letter = fruit[1] print (letter)
Select one:
a. b
b. a
c. n
d. banana
Question 12
Not yet answered
Marked out of 1.00
Flag question
Question text
A variable that has a data type of "str" cannot be a compound data type.
Select one:
True
False
Question 13
Not yet answered
Marked out of 1.00
Flag question
Question text
Traversal can only be accomplished with the "while" loop.
Select one:
True
False
Question 14
Not yet answered
Marked out of 1.00
Flag question
Question text
Strings are easily changed with string slices.
Select one:
True
False
Question 15
Not yet answered
Marked out of 1.00
Flag question
Question text
The elements of a list are immutable.
Select one:
True
False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started