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.
"*" operator seems to be an unpack operator. It is used for unpacking the elements of an array. In the example posted by @SemperPeritus range() function returns an array of elements starting from 1 till N (integer we get as user input). For the print function to access each element of the array so as to print them in one line we need to unpack the array and then give it to the print function to display each element of the array seperated by the specified seperator which in above example seems to be blank ('').
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Print Function
You are viewing a single comment's thread. Return to all comments →
"*" operator seems to be an unpack operator. It is used for unpacking the elements of an array. In the example posted by @SemperPeritus range() function returns an array of elements starting from 1 till N (integer we get as user input). For the print function to access each element of the array so as to print them in one line we need to unpack the array and then give it to the print function to display each element of the array seperated by the specified seperator which in above example seems to be blank ('').