Q:

Python Split a 3 Digit Number in Two Parts

I'm writing code based on the Chocolate Math game (http://www.joe-ks.com/Chocolate_Math.htm). I can get the code to run fine, except for the very last part.
I want the output to read, for example, "Your final number is 533. That means your original number was 5 and you are 33 years old."
What I can't figure out is how to print only the last two digits of the three digit number.
    orig_num = int(input("Okay, tell me how many times a week you want chocolate. It should be more than one, but less than 10: "))

    guess = ((orig_num * 2) + 5) * 50

    birthday = input("Have you had your birthday this year? Y/N: ")
    if birthday == 'Y':
        guessb = guess + current_year - 250
    elif birthday == 'N':
        guessb = guess + current_year - 251

    year = int(input("What year were you born? (Don't worry, I won't look): "))
    less_year = guessb - year

    print("Well! Your number is {}. That means your original number was {}, and you are {} years old".format(less_year, orig_num, less_year))

I feel as though I should have a function in here somewhere, but I'm too green to know where.

A:

You have multiple ways to solve it - one would be to use modulus, i.e. 533%100=33 or you can just treat it as a string an select last 2 digits str(533)[-2:].

