# Syntax of PYTHON

**URL:** <https://discuss.python.org/t/syntax-of-python/2476>\
**Category:** Python Help\
**Created:** [October 14, 2019, 9:34am UTC](https://discuss.python.org/t/syntax-of-python/2476 "2019-10-14T09:34:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FadyD12](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/fadyd12/32/1967_2.png) [@FadyD12](https://discuss.python.org/u/FadyD12)\
**Post date:** [October 14, 2019, 9:34am UTC](https://discuss.python.org/t/syntax-of-python/2476/1 "2019-10-14T09:34:37Z")

</div>

Hello ,

Can someone explain to me the difference between print and pprint?

---

<div class="post-metadata">

**Author:** ![steven.daprano](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steven.daprano/32/1083_2.png) [@steven.daprano](https://discuss.python.org/u/steven.daprano)\
**Post date:** [October 14, 2019, 10:52am UTC](https://discuss.python.org/t/syntax-of-python/2476/2 "2019-10-14T10:52:22Z")

</div>

`print` is a built-in function which prints values with very little  
additional formatting.

`pprint` is a function that has to be imported from the module also  
called “pprint”. It tries to “pretty print” values and make them nicer  
to look at, usually by printing one item per line.

```
>>> from pprint import pprint
>>> D = dict(zip(range(1000, 10010), range(20000, 20010)))
>>> print(D)
{1008: 20008, 1009: 20009, 1000: 20000, 1001: 20001, 1002: 20002, 1003: 20003, 1004: 20004, 1005: 20005, 1006: 20006, 1007: 20007}
>>>
>>> pprint(D)
{1000: 20000,
 1001: 20001,
 1002: 20002,
 1003: 20003,
 1004: 20004,
 1005: 20005,
 1006: 20006,
 1007: 20007,
 1008: 20008,
 1009: 20009}
>>>

```

See the documentation here:

[https://docs.python.org/3/library/functions.html#print](https://docs.python.org/3/library/functions.html#print)

[https://docs.python.org/3/library/pprint.html](https://docs.python.org/3/library/pprint.html)
