Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
9

replit import clear

RubiksCubeworld
RubiksCubeworld

Back then, from replit import clear worked. Now it doesn't. What happened?

3 years ago

Voters

Comments

TopNew
2
ash15khng
ash15khng

For some reason the replit module isn't preinstalled anymore, so you have to add the replit module using the package section at the sidebar before importing.

3 years ago
1
  1. Add the replit package
  2. import clear function from replit module
  3. Use it!

An example:

from replit import clear for _ in range(100): print("x" * 20) _clear = input("Clear terminal? Y or N: ") if _clear in ["y", "Y"]: clear()
3 years ago
1
ArjunSS1
ArjunSS1

@malvoliothegood
that is good code but you can just do clear.lower() == 'y':

3 years ago
Load more