title: How do you duplicate consonants in a string in python?
body: <p><strong>Define</strong> a function called <strong>double_consonants</strong> that doubles all consonants in a string. The function defines one formal parameter which represents the string to be altered. What the function will do is build a new string where all consonants will be doubled. For example, given the value <strong><em>‘Computer Science’</em></strong>, the outputted value would look like: <strong><em>‘CCommpputterr SSccienncce’</em></strong>. You will need the following two variables to help you accomplish this task:</p>
  
  <p>a. A variable that references all upper and lowercase consonants.</p>
  
  <p>b. A variable that references/assigns an empty string. This variable will hold the new string to be built one character at a time.</p>
  
  <pre><code>def double_consonants(string_to_alter):
      '''
      @description double all consonants in a string
  
      @input string_to_alter the original string
  
      @return an altered version of the original string
          with doubled constonants.
      '''
  
      consonants = ["b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z,B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z"]
      no_consonants = ""
  
      for letter in string_to_alter:
          if letter in consonants:
  
  doubled = double_consonants('Computer Science')
  print(doubled)
  </code></pre>