Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Prasanna 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