0% found this document useful (0 votes)
58 views6 pages

Questions 1.1

The document appears to be a series of 10 multiple choice questions from a Python quiz. For each question, it provides the question text, possible answer choices, and feedback on whether the answer was correct or incorrect. The feedback sometimes includes the correct answer. The questions cover topics like Python lists, strings, slicing, and output of sample code blocks.

Uploaded by

sara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views6 pages

Questions 1.1

The document appears to be a series of 10 multiple choice questions from a Python quiz. For each question, it provides the question text, possible answer choices, and feedback on whether the answer was correct or incorrect. The feedback sometimes includes the correct answer. The questions cover topics like Python lists, strings, slicing, and output of sample code blocks.

Uploaded by

sara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Question 1

Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

What is the output of the following Python 3 program?

mylist = ["now", "four", "is", "score", "the", "and seven", "time", "years", "for"]
a=0
while a < 8:
print(mylist[a],)
a=a+2
Select one:
a. now is the time
b. now is the time for
c. four score and seven years

d. now four is score the and seven time years for

Feedback

The correct answer is: now is the time

Question 2
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

What is the output of the following Python program?


mylist = ["now", "four", "is", "score", "the", "and seven", "time", "years", "for"]
print(" ".join(mylist[1::2]))
Select one:
a. now is the time
b. now is the time for
c. four score and seven years

d. now four is score the and seven time years for

Feedback

Your answer is incorrect.


The correct answer is: four score and seven years

Question 3
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

The Python expression 'Unit 6'[-1] has value '6'.


Select one:
True

False

Feedback

The correct answer is 'True'.

Question 4
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

This Python code:

for fruit in ["banana", "apple", "quince"]:


print (fruit)

will produce this output:

banana apple quince


Select one:

True
False

Feedback

The correct answer is 'False'.

Question 5
Correct
Mark 1.00 out of 1.00

Flag question

Question text

In Python, a list of characters is the same as a string.


Select one:
True

False

Feedback

The correct answer is 'False'.

Question 6
Correct
Mark 1.00 out of 1.00

Flag question

Question text
A variable that has a data type of "str" cannot be part of a compound data type
Select one:
True

False

Feedback

The correct answer is 'False'.

Question 7
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

What is the output of the following Python program?


index = "Ability is a poor man's wealth".find("W")
print(index)
Select one:
a. 24

b. 0
c. 23
d. -1

Feedback

Your answer is incorrect.


The correct answer is: -1

Question 8
Incorrect
Mark 0.00 out of 1.00

Flag question
Question text

What is the output of the following Python program?

mylist = [ [2,4,1], [1,2,3], [2,3,5] ]


a=0
total = 0
while a < 3:
b=0
while b < 2:
total += mylist[a][b]
b += 1
a += 1
print(total)
Select one:
a. 14
b. 23
c. 0

d. 13

Feedback

The correct answer is: 14

Question 9
Incorrect
Mark 0.00 out of 1.00

Flag question

Question text

String objects are modified with string slices.


Select one:

True
False

Feedback

The correct answer is 'False'.


Question 10
Correct
Mark 1.00 out of 1.00

Flag question

Question text

The elements of a list are immutable.


Select one:
True

False

Feedback

The correct answer is 'False'.

You might also like