How do I run two functions at the same time?
Consider the following example code:
from time import sleep
userinps = []
def inp():
while True:
userinp = input("Your input: ")
userinps.append(userinp)
def outp():
while True:
print("Your inputs: " + str(userinps))
sleep(10)
How do I run both the functions inp() and outp() at the same time? I want to accept user input and print text every random amount of time in my project.
Also how do I clear the text that the user inputted and the the string "Your Input: " (after pressing enter)?