Python Python Basics All Together Now Branch and Loop

Tyler Wells
Tyler Wells
Python Web Development Techdegree Student 2,677 Points

Why write while tickets_remaining >=1

Why would we write while tickets_remaining >= 1 rather than while tickets_remaining > 0? Is either one more correct in terms of writing the script?

Thanks for the help!

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Staff

Hi there, Tyler Wells! Both are absolutely valid and serve the same purpose. My instinct is to say that he did it this way just to be extra clear that tickets are, in fact, available for sale.

Hope this helps! :sparkles: