0% found this document useful (0 votes)
54 views5 pages

Module 2

Uploaded by

Nagamani V
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)
54 views5 pages

Module 2

Uploaded by

Nagamani V
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/ 5

IBM PY0101EN

Help
Python Basics for Data Science

Course Progress Dates Discussion

Course / Module 2 - Python Data Structur… / Graded Quiz: Python Data Structur…

You are taking "Final Exam" as a timed exam. Show more 00:47:33

Previous Next

Graded Quiz: Python Data Structures


Bookmark this page

Graded Quiz due Jun 7, 2024 02:30 IST Completed


Question 1
0.0/1.0 point (graded)
Examine the tuple A=((11,12),[21,22]), which involves a tuple and list. What is the outcome of the following operation A[1]?

11

(11,12)

[21,22]

((11,12),[21,22])


Answer
Incorrect: Review the Lists and Tuples video.

Submit You have used 2 of 2 attempts

Question 2
1.0/1.0 point (graded)
Consider the tuple A=((1),[2,3],[4]), that contains a tuple and list. What is the result of the following operation A[2]?

[2,3]

[4]


Answer
Correct: The third element in the tuple, which has another list within, corresponds to index 2.

Submit You have used 1 of 2 attempts


Question 3
0.0/1.0 point (graded)
The method append does the following:

Creates a new list with an added element.

Merges two lists

Adds multiple elements to a list

Adds one element to a list


Answer
Incorrect: Review the Lists and Tuples video.

Submit You have used 2 of 2 attempts

Question 4
1.0/1.0 point (graded)
Consider the following list: A=["hard rock",10,1.2]

What will list A contain after the following command is run? del(A[1])?

Syntax error

["hard rock",1.2]

["hard rock",10]

[10,1.2]


Answer
Correct: The element in index 1 will be deleted.

Submit You have used 2 of 2 attempts

Question 5
1.0/1.0 point (graded)
If A is a list, what does the following syntax do? B=A[:]

List A gets converted to a set and is loaded to B

Creates a new reference variable B that points to a copy or clone of the original list A

B gets a transposed form of the list A

Assigns list A to list B


Answer
Correct: Creates a new reference variable B that points to a copy or clone of the original list A.

Submit You have used 2 of 2 attempts


Question 6
1.0/1.0 point (graded)
What is the outcome of the following? len(("disco",10,1.2, "hard rock",10))


Answer
Correct: The function “len” returns the number of elements in a list.

Submit You have used 1 of 2 attempts

Question 7
1.0/1.0 point (graded)
Consider the following dictionary:

{"The Bodyguard":"1992", "Saturday Night Fever":"1977"}

Select the values.

"1977"

"1992"

"The Bodyguard"

"Saturday Night Fever"


Answer
Correct:
This is one of the values.
This is one of the values.

Submit You have used 2 of 2 attempts

Question 8
1.0/1.0 point (graded)
The variable release_year_dict is a Python Dictionary. What is the outcome of applying the following method? release_year_dict.values()

Changes the dictionary to a list

Retrieves the values of the dictionary

Retrieves the entire contents of the dictionary

Retrieves the keys of the dictionary


Answer
Correct: This method returns the values.

Submit
Submit You have used 2 of 2 attempts

Question 9
1.0/1.0 point (graded)
Consider the Set: V={'A','B'}, what is the result of V.add('C')?

{‘AC’, ‘BC’}

{'A','B','C'}

Error

{'A','B'}


Answer
Correct: The method will add a new value to the current set.

Submit You have used 1 of 2 attempts

Question 10
1.0/1.0 point (graded)
What is the outcome of the following? '1' in {'1','2'} ?

False

True


Answer
Correct: The conditional statement is true

Submit You have used 1 of 2 attempts

Previous Next

All Rights Reserved


edX
About
Affiliates
edX for Business
Open edX
Careers
News

Legal
Terms of Service & Honor Code
Privacy Policy
Accessibility Policy
Trademark Policy
Sitemap
Cookie Policy
Your Privacy Choices

Connect
Idea Hub
Contact Us
Help Center
Security
Media Kit

© 2024 edX LLC. All rights reserved.


深圳市恒宇博科技有限公司 粤ICP备17044299号-2

You might also like