3
I was trying a new to present the texts in a basic game that I’m creating, which basically gives a sense that the text is being written The code is this below:
def print_slow(txt):
for x in txt:
print(x, end='', flush=True)
time.sleep(0.02)
print()
print_slow("Olá, o dia está belo hoje")
I don’t understand much about functions, but whenever I try to put that function into a input as:
input(print_slow("Olá, como vai?:"))
it works as it should, only that appears a None where you would write:
Olá, como vai?:
None
someone knows why this occurs, and if there is any way to put a input with this function that leaves the text "slow"??
Remove the
print()
after the loop and see what happens– Lucas
@Wilson Bonato I want from the bottom of my heart to thank you for asking this question. Because I had never thought about creating a print slowly and you opened my mind to have several ideas of cool programs to create. <3
– JeanExtreme002