Computer Science, asked by amilio0601, 4 months ago

Write a python program to validate the details provided by a user as part of registering to a web application.


Write a function validate_name(name) to validate the user name
Name should not be empty, name should not exceed 15 characters
Name should contain only alphabets


Write a function validate_phone_no(phoneno) to validate the phone number
Phone number should have 10 digits
Phone number should not have any characters or special characters
All the digits of the phone number should not be same.
Example: 9999999999 is not a valid phone number


Write a function validate_email_id(email_id) to validate email Id
It should contain one '@' character and '.com'
'.com' should be present at the end of the email id.
Domain name should be either 'gmail', 'yahoo' or 'hotmail'
Note: Consider the format of email id to be username@domain_name.com


All the functions should return true if the corresponding value is valid. Otherwise, it should return false.

Write a function validate_all(name,phone_no,email_id) which should invoke appropriate functions to validate the arguments passed to it and display appropriate message. Refer the comments provided in the code.

Note: You may use str.isalpha(), str.isdigit() methods to check whether a string contains alphabets or digits alone.

Answers

Answered by brainlycamila
2

Answer:

In the past, buildings were still stage houses, small, and made by wood. They were not wide enough and they were still very traditional. ... In the present, many houses are in the modern shapes. They are built from bricks and they are wide

Explanation:

mark as brainliest follow me and like my answers

Answered by ruchibs1810
0

Answer:

Validation is the process of assessing the finished product to see if the software satisfies the needs and expectations of the customer.

Explanation:

What is the python program of validation?

Program:

class Password:

   def __init__(self, password):

       self.password = password

   def validate(self):        

       vals = {

       'Password must contain only an uppercase letter.': lambda s: any(x.isupper() for x in s),

       'Password must contain only a lowercase letter.': lambda s: any(x.islower() for x in s),

       'Password must contain  only a digit.': lambda s: any(x.isdigit() for x in s),

       'Password must be at least of 8 characters.': lambda s: len(s) >= 8,

       'Password should not contain white spaces.': lambda s: not any(x.isspace() for x in s)            

       }

       valid = True  

       for n, val in vals.items():                        

          if not val(self.password):                  

              valid = False

              return n

       return valid                

   def compare(self, password2):

       if self.password == password2:

           return True

if __name__ == '__main__':

   input_password = input('Insert Password: ')

   input_password2 = input('Repeat Password: ')

   p = Password(input_password)

   if p.validate() is True:

       if p.compare(input_password2) is True:

           print('OK')

   else:

      print(p.validate())

To learn more about validation refer to :

https://brainly.in/question/3150222

https://brainly.in/question/1609529

#SPJ2

Similar questions