weight = int(raw_input("How many grams does the object weight? ")) if weight >1000: print "It weighs " + str(weight/1000.0) + " kilograms." elif weight > 100: print "It weighs " + str(weight/100.0) + " hectograms." elif weight > 10: print "It weighs " + str(weight/10.0) + " dekagrams." elif weight >= 0: print "It weighs " + str(weight) + " grams." else: print "You entered an invalid number."