+ 1
How to clear screen in python
Like in c++ we use clrscr()
5 Answers
+ 6
I don't think there is any cls() function in C/C++ either.
The only way to clear the screen I know is to invoke command processor using system() function and pass the clearning screen command as argument according the the shell that system is using.{ similar would be for python }
+ 6
This is not valid in any morden standard C/C++ compiler.
The stuff you are using here is 30 years old and was ment to be used for MS-DOS copilers only.
+ 5
Gaurav Yadav first of all, the lines of code you just mentioned use the conio.h header file, which is not avaiable anymore with the c++ compilers. Secondly, adding to Arsenic 's answer, the "clear" command is for linux and macOS and "cls" command is for Windows. So to clear screen, you will import the os module, and will do os.system("clear") in linux and macOS and os.system("cls") in Windows.
+ 2
from os import system
system ('cls') #on win, use third line on Linux
system ('clear')
0
My mistake
#include <conio.h>
clrscr()