Skip to content
Advertisement

Combine Multiple Lists (Python)

I am trying to combine multiple lists in selected format. Simply, trying to create elapsed + "' " + player + ' (A: ' + assist + ') - ' + detail (for example: 51' H. Onyekuru (A: R. Babel) - Normal Goal ). I also added the json file i took the data. Maybe it can be created directly without creating lists.

Code:

JavaScript

JSON file:

JavaScript

Output:

JavaScript

Advertisement

Answer

Sure you can – just iterate over the events and print out those lines (or gather them into a list if you like, for example). The f-string syntax below requires Python 3.6 or newer.

JavaScript

This prints out

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