-1

I was making the first lines of code of a game console project, but after declaring 5 prints I realized that the console had become saturated with text, So I decided to look for how to remove it, but I couldn't find any answer.

print("hello") #when code starts, this is printed
text = input()

if text == "hello":
    #How to remove the previous print from the console?

print("hello2")

maybe a simple line of code can resolve my problem.

I haven't figured a single line of code that can help me yet.

AstroPY23
  • 1
  • 1
  • 1
    Type Ctrl-L to clear the window. – Barmar Aug 16 '23 at 20:58
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 17 '23 at 09:39

1 Answers1

0

If you are asking how to remove the extra text in the console you can try writing "clear" in the console, and it will remove any of the precious text. Your code doesn't have an indentation for your second print statement.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
971munir
  • 3
  • 2