How to create a new user along with password by server side code

this is how I am creating a new user, now i also want to set password to the user how can i set password to the user

i tried with new_user.password = password, but it is not working now how can i set the password of the user and is there any built-in method for creating a user ex: create_user()

@Vinay1 you can use predefined function after creating the user:

from frappe.utils.password import update_password
update_password(name,new_password)

Is it working?

I tried. code executed without any errro / warning.

Also tried via updating user using import through spreadsheet.

Import was successful.

But actually password is not updated in either case.

Can anyone drop some hint?

Which field (and table) store the hashed password?