I want to check if root user exist in AWS account using Python or any cli command.
Thanks
Try these commands
aws iam list-users
aws iam list-roles
Every AWS account has a root user. It cannot be deleted. There is no need to test for the presence of this.
If you're able to retrieve the access key for the root user programmatically (e.g. on the CLI or with boto), then you must be signing the request with the root key, which implies that the account has a root user access key.