I personally use the last method.
In the last one, I think you meant to put name
instead of __name__
.
import os
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
(Also, I’d recommend never to assign lambdas to variables, use functions instead.)