So yeah, i figured out how to write program that will print digits in reverse(with small help of the internet, put i get it). Anyway i want to write program that will print digits in their regular order.

def num_digits(n):
    count=0
    while count <= abs(n):
        count = count + 1
        n= abs(n)/10
        return count
    
def print_digits(n):
    while n > 0:
        print n #my "plan" is to go with n/ (10**num_digits(n)) and that taking
        #taking it like decimal with one decimal place and taking that value)
        #For example: 123 / (10**3) = 0,123. and than fix it so that is 0,1.
        #after this 0,1 * 10 = 1 and here is our 1st digit
        #how u guy understand how i want this to work
        #rest of code
        n=n/10
        print n #not quite sure for this line

help?
p.s. be gentle i'm learning yet

To sort the numbers in their normal meaning -> I deduce you have them as strings now?

I recommend you to learn test based programming: make list of calls to your final function and what should be result of these test cases:
http://diveintopython.org/unit_testing/index.html

Maybe this is of use, but probably too early for this: http://www.daniweb.com/code/snippet284490.html

I do not get it what you really want to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.