Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

PinCode,Mobile Number,Email Validation in Python

DEV Community·PRIYA K·about 1 month ago
#iWzuzOH4
Reading 0:00
15s threshold

1. Check whether a given number is a valid 6-digit pincode or not. def pincode ( pc ): if pc // 100000 != 0 and pc // 100000 <= 9 : print ( " Yes " ) else : print ( " No " ) pincode ( int ( input ( " Enter a pincode : " ))) Enter fullscreen mode Exit fullscreen mode Output 2. Check whether a given email ID is a valid Gmail address or not. def verify_Gmail ( Gmail ): if Gmail [ - 10 :] == " @gmail.com " : i = 0 gmailcopy = Gmail [ 0 : len ( Gmail ) - 10 ] while i < len ( gmailcopy ): current = gmailcopy [ i ] i += 1 if current >= " a " and current <= " z " : continue ; elif current >= " A " and current <= " Z " : continue ; elif current >= " 0 " and current <= " 9 " : continue ; elif current == " . " or current == " _ " : continue ; else : return False return True else : return False if verify_Gmail ( input ( " Enter Your Gmail : " )): print ( " valid " ) else : print ( " invalid " ) Enter fullscreen mode Exit fullscreen mode Output 3.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More