Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

endswith python

#endswith() function: the function of string which returns the value matching 
#the argument or else returns nothing.
example: to check if the given email matches the domain of the sample email.

 a=input('enter email ID :')
if a.endswith('@draken.com'): # here suffix should come @draken.com prefix independent
 print('valid Email ID')
else:
 print('not valid Email ID')
#output
--------------------------------------------------------------------------------------
enter email ID :grayn@draken.com
valid Email ID
--------------------------------------------------------------------------------------
enter email ID :robin@dragon.com
not valid Email ID
--------------------------------------------------------------------------------------
 
PREVIOUS NEXT
Tagged: #endswith #python
ADD COMMENT
Topic
Name
6+5 =