0

Sorry for the basic question. But I cannot find a solution of this problem.

I'd like to print dictionary value at the Django terminal.

Here, I have a dictionary c={'code': '12'}

I just want to print 12 at the terminal But when I enter print(c.values()) in the terminal, nothing appears.

I think the latter ' is the problem. What should I do?

RiuL h
  • 1
  • 2
  • I cannot reproduce what you explained. Please show us the code you tried so we can reproduce it. – user99999 Nov 08 '22 at 14:01
  • Printing `c.values()` should output `dict_values(['12'])`. – user99999 Nov 08 '22 at 14:03
  • Does this answer your question? [How do I print the key-value pairs of a dictionary in python](https://stackoverflow.com/questions/26660654/how-do-i-print-the-key-value-pairs-of-a-dictionary-in-python) – Pravash Panigrahi May 08 '23 at 13:45

1 Answers1

0
print(c["code"])

The c variable is a dictionary, "code" is a key and 12 is a value.

Charly
  • 83
  • 1
  • 8