Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Discover comprehensive answers to your questions from knowledgeable professionals on our user-friendly platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Write a python function that checks whether a string is a valid password. Suppose the password rule is as follows:
• A password must have at least eight characters.
• A password consists of only letters and digits.
• A password must contain at least two digits.
Write a program that prompts the user to enter a password and displays "valid password" if the rule is followed or
"invalid password" otherwise.