Telegram Group & Telegram Channel
Выводим вложенные словари и списки

При выводе вложенных словарей и списков с помощью обычного print() мы получаем всё в одну строчку и в неразборчивом виде.

Но в стандартной библиотеке есть модуль pprint, который поможет вывести подобное дело в красивом формате — достаточно в коде заменить print() на pprint.pprint().

Из интересных аргументов есть depth, отвечающий за глубину вложенности при выводе, а также width, который отвечает за ширину вывода в консоли.

#pprint



tg-me.com/python_academy/685
Create:
Last Update:

Выводим вложенные словари и списки

При выводе вложенных словарей и списков с помощью обычного print() мы получаем всё в одну строчку и в неразборчивом виде.

Но в стандартной библиотеке есть модуль pprint, который поможет вывести подобное дело в красивом формате — достаточно в коде заменить print() на pprint.pprint().

Из интересных аргументов есть depth, отвечающий за глубину вложенности при выводе, а также width, который отвечает за ширину вывода в консоли.

#pprint

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/685

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

Python Academy from sg


Telegram Python Academy
FROM USA