title: How do I run one def function inside of a different def function in python?
body: <p>I'm trying to run a timer inside of a function of my code. I need to start the timer slightly before the user starts typing, then stop the timer when the user has entered the alphabet correctly.
  Here is my code:</p>
  
  <pre><code>import time
  timec = 0
  timer = False
  
  print("Type the alphabet as fast as possible.\nYou MUST be accurate!\nYou will be timed")
  timer = True
  attempt = input("The timer has started!\nType here: ")
  
  while timer == True:
      time.sleep(1)
      timec = timec +1
  
  
  if attempt == "abcdefghijklmnopqrstuvwxyz":
      timer = False
      print("you completed the alphabet correctly in", timec,"seconds!")
  else:
      print("There was a mistake! \nTry again: ")
  </code></pre>
  
  <p>The issue is that it will not let me enter the alphabet. In previous attempts of this code (Which I do not have) i have been able to enter the alphabet, but the timer would not work. Any help is appreciated </p>