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.
In the above code, the i will print from 0 to 5. To include 6 also, we need to provide 7 in the place of 6 as range() uses a number less than the provided one.
So, as per the question, we also need the number provided in the range i.e, x. So we provide a number just above x, that is x+1.
Hope you have understood.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
In the above code, the i will print from 0 to 5. To include 6 also, we need to provide 7 in the place of 6 as range() uses a number less than the provided one. So, as per the question, we also need the number provided in the range i.e, x. So we provide a number just above x, that is x+1. Hope you have understood.