mail@pastecode.io avatar
7 months ago
976 B
#Email Validation:

1.import re module
2.take the i/p from user as a email-id
3.made one pattern 
4.use search() to check that pattern with user input(email-id)
  and store this result in one variable.
5.if that variable is not None ,then it is valid email-id else it is invalid email-id


#Counting of valid and invalid email-id:

1.One file is created and store all email-id (valid and invalid email-id) into that file.

2.import re module

3.declare 2 counter valid-counter and invalid-counter

4.open that file in read mode.

5.use for loop to check email-id one by one from that file.

6.declare 1 variable inside that we use search() to match pattern with that email-id.

7.if that variable is not None then it is valid email-id and valid-counter increamented by 1

8.else it is invalid email-id and invalid-counter is increamented by 1.

9.Print both valid-counter and invalid-counter.
Leave a Comment