Registry Synced

Jan 2026 - Python - Week 6 - Graded Assignment 6

2022 words
10 min read

Week 6 - Graded Assignment 6

Course: Jan 2026 - Python
Week 6 - Graded Assignment 6
Last Submitted: You have last submitted on: 2026-03-25, 14:15 IST

Question 1

Assume l is a variable of type list, what is the type of the expression l.append([5])?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: NoneType
Accepted Answers:
NoneType

Question 2

Assume l is a variable of type list, what is the type of the expression l.extend((5))?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 3

Assume l is a variable of type list, what is the type of the expression l[:2]?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: list
Accepted Answers:
list

Question 4

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.index('hi') if 'hi' is present in the list?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: int
Accepted Answers:
int

Question 5

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.index('hi') if 'hi' is not present in the list?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 6

Assume l is a variable of type list and has elements of type str, what is/are the type(s) of the expression 'hi' in l and l.index('hi') if 'hi' is not present in the list?
  • bool
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Feedback/Explanation: bool
int
Accepted Answers:
bool
int

Question 7

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.remove('hi') if 'hi' is present in the list?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: NoneType
Accepted Answers:
NoneType

Question 8

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.remove(1) if the list has more than 2 elements?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 9

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.pop() if the list has more than 2 elements?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: str
Accepted Answers:
str

Question 10

Assume l is a variable of type list and has elements of type str, what is the type of the expression l.pop() if the list is empty?
  • int
  • str
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 11

Assume s is a variable of type set, what is the type of the expression s.sort()?
  • int
  • str
  • list
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 12

Assume t is a variable of type tuple, what is the type of the expression sorted(t)?
  • int
  • str
  • list
  • tuple
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: list
Accepted Answers:
list

Question 13

Assume t is a variable of type tuple, what is the type of the expression t.reverse()?
  • int
  • str
  • list
  • tuple
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 14

Assume t is a variable of type tuple and has elements of type str, what is the type of the expression t.index('hi') if 'hi' is present in the t?
  • int
  • str
  • list
  • tuple
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: int
Accepted Answers:
int

Question 15

Assume s is a variable of type set, what is the type of the expression s | {1,2}?
  • int
  • str
  • list
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: set
Accepted Answers:
set

Question 16

Assume s is a variable of type set, what is the type of the expression {1,2} in s?
  • int
  • bool
  • str
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: bool
Accepted Answers:
bool

Question 17

Assume s is a variable of type set, what is the type of the expression (1,2) in s?
  • int
  • bool
  • str
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: bool
Accepted Answers:
bool

Question 18

Assume s is a variable of type set, what is the type of the expression s.update({1,2})?
  • int
  • bool
  • str
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: NoneType
Accepted Answers:
NoneType

Question 19

Assume s is a variable of type set, what is the type of the expression s.update((1,2))?
  • int
  • bool
  • str
  • set
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: NoneType
Accepted Answers:
NoneType

Question 20

Assume t is a variable of type tuple with elements of type int, what is the type of the expression t.pop()?
Also assume that the tuple has 10 elements.
  • int
  • bool
  • str
  • tuple
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 21

Assume d is a variable of type dict, what is the type of the expression sorted(d)?
  • int
  • str
  • dict
  • list
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: list
Accepted Answers:
list

Question 22

Assume d is a variable of type dict, what is the type of the expression d.append(5)?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 23

Assume d is a variable of type dict, what is the type of the expression d.update((5,6))?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 24

Assume d is a variable of type dict, what is the type of the expression d.add(5,6)?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 25

Assume d is a variable of type dict, what is the type of the expression (d | {5:6}).pop()?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 26

Assume d is a variable of type dict, what is the type of the expression (d | {5:6}).pop(5)?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: int
Accepted Answers:
int

Question 27

Assume d is a variable of type dict, what is the type of the expression (d | {5:{5:6}}).pop(5)[5]?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: int
Accepted Answers:
int

Question 28

Assume d is a variable of type dict, what is the type of the expression (d | {5:{5:6}}).pop(5)?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: dict
Accepted Answers:
dict

Question 29

Assume d is a variable of type dict, what is the type of the expression d.key()?
  • int
  • str
  • list
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
  • None of the Above
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: Invalid Expression (Raises Error)
Accepted Answers:
Invalid Expression (Raises Error)

Question 30

Assume d is a variable of type dict, what is the type of the expression d.popitem()?
Also assume d is non empty.
  • int
  • str
  • list
  • tuple
  • dict
  • NoneType
  • Invalid Expression (Raises Error)
  • None of the Above
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: tuple
Accepted Answers:
tuple

Document Outline
Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.