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.
1 means True while 0 means False. There is a difference when in Python 2, True is not a keyword but it is in Python 3. while True or while 1 will run your program indefinitely. while True should only be used if you have no condition for breaking out of the loop; in this case the loop should break when there are no more queries.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 8: Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
1 means True while 0 means False. There is a difference when in Python 2,
Trueis not a keyword but it is in Python 3.while Trueorwhile 1will run your program indefinitely.while Trueshould only be used if you have no condition for breaking out of the loop; in this case the loop should break when there are no more queries.