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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 🗳️
Reference:
https://www.afternerd.com/blog/python-lists-for-absolute-beginners/

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
TheFivePips
3 months, 3 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
4 months 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, 3 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
1 year, 10 months ago
Selected Answer: BD
B and D are right
upvoted 2 times
...
666_m
1 year, 10 months ago
B& D are correct.
upvoted 1 times
...
macxsz
1 year, 11 months ago
Selected Answer: BD
B. Tuples may be stored inside lists D. Lists may be stored inside lists
upvoted 1 times
...
DKM
2 years, 4 months 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
2 years, 4 months 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 ...