title: Confused about if statements and functions
body: <p>I'm very familiar with the random module but I always stumbled when it came to functions. How do I make a function only occur if it meets a certain condition? It gives me no output when im trying to validate my answer...</p>
  <pre><code>choice = input (&quot;Which type of password would you like to generate? \n 1. Alphabetical \n&quot;)
  
  if choice == 1:
      characters = list(string.ascii_letters)
      def generate_random_abc_password():
              length = int(input(&quot;Enter password length: &quot;))
  
              random.shuffle(characters)
              
              password = []
              for i in range(length):
                      password.append(random.choice(characters))
  
              random.shuffle(password)
  
              print(&quot;&quot;.join(password))
              
      generate_random_abc_password()
  </code></pre>