title: How to sort digits in a number?
body: <p>I'm trying to make an easy script in Python which takes a number and saves in a variable, sorting the digits in ascending and descending orders and saving both in separate variables. Implementing <a href="http://en.wikipedia.org/wiki/6174" rel="noreferrer">Kaprekar's constant</a>.</p>
  
  <p>It's probably a pretty noobish question. But I'm new to this and I couldn't find anything on Google that could help me. A site I found tried to explain a way using lists, but it didn't work out very well.</p>