- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to concatenate a Python dictionary to display all the values together?
You can get all the values using a call to dict.values(). Then you can call ", ".join on the values to concatenate just the values in the dict separated by commas.
example
a = {'foo': "Hello", 'bar': "World"} vals = a.values() concat = ", ".join(vals) print(concat)
Output
This will give the output −
Hello, World
Advertisements