Python: python equivalent of php var_dump

Trabla: Python: python equivalent of php var_dump

Solving:

repr(object)

https://docs.python.org/2/library/functions.html#repr

Example:

cities = [ {'name':'New York','population':8405837},{'name':'London','population':8416535}]
print repr(cities)

Output:
[{'name': 'New York', 'population': 8405837}, {'name': 'London', 'population': 8
416535}]

No comments:

Post a Comment