Skip to content
Advertisement

Print specific values from a dictionary, then go to the next line

Right now I am manually typing in every single key for the print lines at the bottom like this :

JavaScript

However this seems like an unnecessarily long way of doing this and if I wanted to make the grid any bigger, it would take a while to type in every value. Is there a better way of doing this?

Advertisement

Answer

Use a loop and join()

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement