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.
Could someone explain to me what, exactly, this code does (like, statement-by-statement)(other than the input part I understand that I mostly mean the list comprehension)? I sort of have a basic understanding of how it works, but having some trouble wrapping my head around list comprehensions and how exactly the work. Mostly the "for a in range(0,x+1)" parts. What exactly does that do? Why is it (0,x+1)? Thanks in advance.
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 →
Could someone explain to me what, exactly, this code does (like, statement-by-statement)(other than the input part I understand that I mostly mean the list comprehension)? I sort of have a basic understanding of how it works, but having some trouble wrapping my head around list comprehensions and how exactly the work. Mostly the "for a in range(0,x+1)" parts. What exactly does that do? Why is it (0,x+1)? Thanks in advance.