If the accused person pleads guilty, the judge may hear evidence touching on the nature of the case, or otherwise ascertain the facts thereof, and after such hearing, may refuse to accept the plea or may accept the plea, assess the punishment and enter the proper judgment.
K.S.A. 19-4722