0

When I run this code it has an output of "none"

def typewrite(string):
    for i in string:
        sys.stdout.write(i)
        sys.stdout.flush()
        time.sleep(0.04)


username = input(typewrite(f'''

    ░▒▓▆▅▃▂▁ ▁▂▃▅▆▓▒░   

    Welcome adventurer, what is your name? 
'''))
print(typewrite("Alright hero " + username + " let the adventure begin!"))

screenshot of output

I don't know what to try and I expect it to not have "none"

wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • Welcome to Stack Overflow! Please take the [tour]. [Please don't post pictures of text](https://meta.stackoverflow.com/q/285551/4518341). Instead, copy the text itself, [edit] it into your post, and use [code formatting](/editing-help#code). BTW, for more tips, check out [ask]. – wjandrea Nov 26 '22 at 18:23
  • SO is a Q&A site, but you haven't asked a question, so I'm assuming you want to ask *why* the `None` is there, which we already have questions about, so I've closed it accordingly. However, the solution in this case I think would be the opposite: don't print the result of the function; do `typewrite(...); username = input(); typewrite(...)`. – wjandrea Nov 26 '22 at 18:31
  • BTW, you're using an f-string where you shouldn't (since there are no replacement fields) and not using one where you should: `f"Alright hero {username} let the adventure begin!"` – wjandrea Nov 26 '22 at 18:37

0 Answers0