Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPrasanna kadel
Courses Plus Student 1,057 Pointsdidnt understand the shopping list take 3
Why did he import os ?
1 Answer
Dylan Jackson
Courses Plus Student 1,906 PointsNT is the windows kernel, so CLS would clear the screen. *nix kernels have different names and commands, so you would use "clear" to clear the terminal screen in a *nix OS, such as Apple's OSX, or Debian, Mint, RHEL, etc.
The OS package that was imported lets him check the name of the kernel for comparison.
Shana HT
3,292 PointsShana HT
3,292 PointsHe uses it in this function:
It calls the operating system to clear the console screen, depending on which operating system the user is running. This function is called before a list is printed. The way he uses the if statement, is like a shortcut.
This function would do the same thing