How to dynamically create a variable, initialize list and append elements to it using exec in python?
Consider you are given a string which should be converted into a variable. The following piece of code helps to achieve that.
Consider your are given a list of strings and each string should be converted into a list. Consider you are given a list of various country names and football players names. The problem statement is to create a list for each country and assign the football players to the list (It’s Euros2020 time!!!!!). For simplicity purpose, I have just taken 3 countries and another list has 3 football players where each footballer’s index corresponds to the country’s index.