Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 14 discussion

Actual exam question from Python Institute's PCAP
Question #: 14
Topic #: 1
[All PCAP Questions]

Which of the following sentences are true? (Choose two.)

  • A. Lists may not be stored inside tuples
  • B. Tuples may be stored inside lists
  • C. Tuples may not be stored inside tuples
  • D. Lists may be stored inside lists
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
TheFivePips
11 months, 4 weeks ago
A. Lists may not be stored inside tuples This statement is incorrect. In Python, lists can be stored inside tuples. Tuples are immutable, but they can contain mutable elements like lists. B. Tuples may be stored inside lists This statement is correct. In Python, you can have a list that contains elements of various types, including tuples. C. Tuples may not be stored inside tuples This statement is incorrect. Tuples can indeed be stored inside other tuples. Tuples in Python can contain elements of various types, and this includes other tuples. D. Lists may be stored inside lists This statement is correct. In Python, you can have a list that contains elements of various types, including other lists. So, the correct answers are B and D.
upvoted 1 times
...
pincholinco
1 year ago
they are all true nothing stops you from storing anything inside a touple you shouldn't store a list because that defeats the point of tuple since the tuple element (the list) can now be modified but I suppose it will need to remain a list.
upvoted 1 times
...
naveenbv80
1 year, 12 months ago
list_inside_tuple = ([1, 2], [3, 4], [5, 6]) print(list_inside_tuple) tuple_inside_list = [(1,2),(2,3),(4,5),(3,4),(6,7),(6,7),(3,8)] print(tuple_inside_list) my answer is B and D
upvoted 1 times
...
palagus
2 years, 6 months ago
Selected Answer: BD
B and D are right
upvoted 2 times
...
666_m
2 years, 6 months ago
B& D are correct.
upvoted 1 times
...
macxsz
2 years, 7 months ago
Selected Answer: BD
B. Tuples may be stored inside lists D. Lists may be stored inside lists
upvoted 1 times
...
DKM
3 years ago
lists inside tuple: t = ([1, 2], [3, 4], [5, 6]) for i in t: for j in i: print(j)
upvoted 1 times
...
DKM
3 years ago
tuple inside list : L = [(1,2),(2,3),(4,5),(3,4),(6,7),(6,7),(3,8)]
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...