Y
Y
Yura Mailler2021-09-05 18:45:37
C++ / C#
Yura Mailler, 2021-09-05 18:45:37

How to make a key-value list in C#?

In Python, there are such lists when you make the name of the list element (for example, "name") and opposite it through: something for this element (for example, "Egor"),
if I'm not mistaken, it is written like this:

{
    name : Egor
}

well, then in the code you can refer to the list and find the element and find out the tex or numbers of this element (most likely I told you badly, because I only studied Python when I started to get comfortable in programming).
Well, I need something like this, only in C#.
I have a store and with the help of this list I want to make the name of the skin and its cost.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2021-09-05
@Yura111

Dictionary

M
mletov, 2021-09-05
@mletov

If in a simple way, then Enum, if more flexible, thenList<T>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question