Search
 
SCRIPT & CODE EXAMPLE
 

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
--------------------------------------------------------------------------------------
Comment

python string ends with

#!/usr/bin/python

str = "this is string example....wow!!!";

suffix = "wow!!!";
print str.endswith(suffix)
print str.endswith(suffix,20)

suffix = "is";
print str.endswith(suffix, 2, 4)
print str.endswith(suffix, 2, 6)
Comment

PREVIOUS NEXT
Code Example
Python :: how to make getter in python 
Python :: curl python 
Python :: spyder - comment banch of codee 
Python :: convert number from one range to another 
Python :: unpack too many values in python 
Python :: scikit learn lda 
Python :: python display name plot 
Python :: time addition in python 
Python :: python convert string to float array 
Python :: input command in python shell 
Python :: python swap two values in list 
Python :: scipy euclidean distance 
Python :: check if path exists python 
Python :: how to make a list string in python 
Python :: Save a Dictionary to File in Python Using the dump Function of the pickle Module 
Python :: delete nans in df python 
Python :: seaborn pairplot 
Python :: python remove whitespace from start of string 
Python :: python list comprehension cartesian product 
Python :: if else python 
Python :: streamlit python install 
Python :: append path to sys jupyter notebook 
Python :: lexicographic order python 
Python :: pandas drop column in dataframe 
Python :: login_required on class django 
Python :: pil crop image 
Python :: knowing the sum null values in a specific row in pandas dataframe 
Python :: Convert DateTime to Unix timestamp in Python 
Python :: chr() python 
Python :: python define random variables name 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =