title: Addition carries in Python
body: <pre><code>number1 = int(input('Number #1: '))
  number2 = int(input('Number #2: '))
  l = len(str(number1))
  l1 = len(str(number2))
  print()
  
  def addition():
      print(' ',max(number1,number2))
      print('+')
      print(' ',min(number1,number2))
      print('-'*(max(l,l1)+2))
      print('  ')
      print(' ',number1+number2)
  
  def carries():
      while (int(str(number1)[::-1])+int(str(number2)[::-1]))&gt;=10:
          carries = 0
          carries = carries + 1     
          return carries
  
  addition()
  
  
  print()
  print('Carries : ',carries())
  </code></pre>
  
  <p>I am trying to make a program that does the addition of two user input numbers and calculates the answer while also stating how many carries there are. Carries being if 9+8=17, then there would be 1 carry and so forth. I am having issues with having my program go beyond 1 carry. So this program so far is only applicable for user input numbers that when added are below 99. If you could explain to me how I would go about altering this program to make it applicable to any numbers, that would be great. I was thinking about using the len(number1) and len(number2) and then inputting the string of the user input backwards so it would look like str(number1[::-1])) but I do not think it works like that.   </p>