We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
if we don't want to store the input() value then we can do like this. Here input() will execute and asks for users input() and then it will check the particular key in defaultdict and return a list.So know we wanna concatenate the list values but .join() always receives string instance so we need to type cast each element of returned list into string so we are using map function. map() will retrieve element of list one by one and type cast it to string...
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
DefaultDict Tutorial
You are viewing a single comment's thread. Return to all comments →
if we don't want to store the input() value then we can do like this. Here input() will execute and asks for users input() and then it will check the particular key in defaultdict and return a list.So know we wanna concatenate the list values but .join() always receives string instance so we need to type cast each element of returned list into string so we are using map function. map() will retrieve element of list one by one and type cast it to string...