raise an TypeError exception with an argument string "Variable must be a string or number, got %s", replace '%s' with type of var.
raise TypeError ( "Variable must be a string or number, got %s" % type ( var ) )