exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 232 discussion

Actual exam question from CompTIA's PT0-002
Question #: 232
Topic #: 1
[All PT0-002 Questions]

Given the following code:



Which of the following data structures is systems?

  • A. A tuple
  • B. A tree
  • C. An array
  • D. A dictionary
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
TheSkyMan
Highly Voted 2 years, 4 months ago
Selected Answer: D
- List: Sys = [1, 2, 3] - Dictionary: Sys = {"Linux":1, "Mac":2, "Windows":3} - Tuple: Sys = ("Linux", "Mac", "Windows") -> Dictionary https://www.devopsschool.com/blog/python-tutorials-difference-between-list-array-tuple-set-dict/
upvoted 7 times
...
Etc_Shadow28000
Most Recent 1 year ago
Selected Answer: D
D. A dictionary Explanation: • Tuple: A tuple in Python is an ordered collection of items that are immutable. Tuples are defined using parentheses () and can contain multiple elements. • Tree: A tree is a hierarchical data structure consisting of nodes, where each node has zero or more children nodes. Trees are not a built-in data structure in Python like lists or dictionaries. • Array: An array is a collection of items stored at contiguous memory locations. Arrays are typically used to store elements of the same type. In Python, lists are used instead of arrays and are defined using square brackets []. • Dictionary: A dictionary in Python is an unordered collection of key-value pairs. Dictionaries are defined using curly braces {} and are indexed by keys. Each key is mapped to a value.
upvoted 1 times
...
r3vrnd
1 year, 4 months ago
answer D another 100% provable incorrect answer provided by examtopics. Pretty sure they would fail the exam. might ask for a refund.
upvoted 2 times
HarryBosbourne
1 year, 4 months ago
That's a massive over exaggeration. Most of these answers are correct and discussions clarify the one's that aren't.
upvoted 3 times
...
...
[Removed]
2 years, 3 months ago
Selected Answer: D
The data structure in the given code is a dictionary, which maps IP addresses to operating system names. The syntax for creating a dictionary in Python is using curly braces {} and separating keys and values with colons (:), and separating items with commas (,). Therefore, the correct answer is: D. A dictionary
upvoted 1 times
...
nickwen007
2 years, 4 months ago
An example of a dictionary is a collection of key-value pairs, such as {'one':1, 'two':2, 'three':3}. An example of an array is a collection of elements stored in sequential order, such as [1, 2, 3]. An example of a tree is a hierarchical structure composed of nodes, such as the family tree. An example of a tuple is a fixed-length sequence of elements, such as (1, 2, 3).
upvoted 2 times
...
nickwen007
2 years, 4 months ago
System = {"10.10.10.1" : "windows 10"} is a dictionary, which is a type of data structure that stores information in key-value pairs. This type of data structure is often used in programming languages such as Python and JavaScript. It can be used to store and retrieve data quickly, such as IP addresses and operating systems in this example.
upvoted 3 times
[Removed]
2 years, 4 months ago
D is the answer
upvoted 1 times
...
...
cy_analyst
2 years, 4 months ago
Selected Answer: D
The data structure systems is a dictionary, as indicated by the use of curly braces {} and the key-value pairs separated by colons :. Each key-value pair represents an entry in the dictionary, with the IP address as the key and the corresponding operating system as the value.
upvoted 3 times
...
kenechi
2 years, 4 months ago
Selected Answer: D
D - Dictionary.
upvoted 4 times
[Removed]
2 years, 4 months ago
D is the answer for sure?
upvoted 2 times
...
...
BigBeeerd
2 years, 4 months ago
Selected Answer: D
https://www.devopsschool.com/blog/python-tutorials-difference-between-list-array-tuple-set-dict/
upvoted 3 times
[Removed]
2 years, 4 months ago
I think D is the answer
upvoted 2 times
...
...
[Removed]
2 years, 5 months ago
I think Anarry is correct
upvoted 1 times
...
Frog_Man
2 years, 5 months ago
A - tuple. Tuple is an ordered set of values separated by a comma.
upvoted 1 times
[Removed]
2 years, 5 months ago
Why not D or C ?
upvoted 1 times
...
...
josepa
2 years, 5 months ago
D, https://realpython.com/python-dicts/#defining-a-dictionary
upvoted 4 times
[Removed]
2 years, 5 months ago
Why not C ?
upvoted 1 times
[Removed]
2 years, 5 months ago
I think C is anarry the answer
upvoted 1 times
...
...
kenechi
2 years, 4 months ago
D - is correct
upvoted 3 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 ...