x = raw_input("Enter a grade:") #x will be treated as an int after this x_int = int(x) if x_int>100: print '"' + x + '" is too large (original string x)' print '"' + str(x_int) + '" is too large (x_int cast to str)' #WarningL this line will cause an error #Remove the error by casting x back to a string # with str(x) try: print '"' + x_int + '" is too large' except: print "Error: Cannot combine string and int" elif x_int<0: print x_int, 'is too small' else: print x_int, ' is a valad grade' print 0 <= x_int <= 100