A
A
Anton2021-08-17 21:10:38
Python
Anton, 2021-08-17 21:10:38

How to select values ​​from these Python attributes?

Greetings! For example, there is a code:

test = Test()
print(test.attrs.__dict__['something'].__dict__)
Which outputs the result for example like this:
{ 'word': 'smile', 'word1': 'sky'}

How to get values ​​from these attributes so that it looks like this:
print(word)
print(word1)
And output result:
smile
sky

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2021-08-17
@boypush

You, pythonists, are already lazy
https://pythonworld.ru/tipy-dannyx-v-python/slovar...
I'm waiting for the question "How to output text to the console in python?"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question