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