title: Rounding a number up to the nearest ten
body: <p>I need a piece of code in my program which will get a number, "dSum" in my code, and round it <strong>up</strong> to the nearest ten. For example, if dSum is 33, I need dSumRounded to be 40. The line of code I already have is wrong, it seems to be rounding <strong>down</strong> to the nearest ten. I found that piece of code from another stackoverflow question, but it just isn't working in this situation.</p>
  
  <pre><code>import math #Imports the math library
  
  def findCheckDigit():
      code = input("Please enter your 7 digit code: ")  #Makes a function and sets the code to a variable
  
      d1 = int(code[0]) * 3
      d2 = int(code[1]) * 1
      d3 = int(code[2]) * 3
      d4 = int(code[3]) * 1    #Seperates each digit and assigns it to a variable, multiplying it by 3 or 1 
      d5 = int(code[4]) * 3
      d6 = int(code[5]) * 1
      d7 = int(code[6]) * 3
  
      dSum = d1 + d2 + d3 + d4 + d5 + d6 + d7      #Adds each digit together
      dSumRounded = int(math.ceil(dSum / 10.0)) * 10   #Gets the rounded up version of the sum of the digits
      checkDigit = dSumRounded - dSum   #Makes the check digit equal to the sum of digits taken away from the rounded up sum of digits
  
      print(dSumRounded)
      print("Your check digit is: " + str(checkDigit))   #Prints the check digit
  </code></pre>