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 detect the reaction to a message discord.py 
Python :: keep tkinter window below others 
Python :: Python Date object to represent a date 
Python :: is coumn exist then delete in datafrmae 
Python :: how to merge two dictionaries with same keys in python 
Python :: find word position in string python 
Python :: no module named googlesearch 
Python :: pandas replace nan with value above 
Python :: sequenza di fibonacci python 
Python :: image.open no such file or directory 
Python :: hover show all Y values in Bokeh 
Python :: how to change todays date formate in python 
Python :: hash with python 
Python :: yticks matplotlib 
Python :: update xls file using python 
Python :: pyaduio 
Python :: Python Frozenset() for Dictionary 
Python :: django pagination class based views 
Python :: change the number in 3rd line to get factorial for the number you want. Ex: num = 30 
Python :: python find string count in str 
Python :: python format strings 
Python :: python try else 
Python :: python lambda function if else 
Python :: how to set a single main title above all the subplots with pyplot 
Python :: tkinter include svg in script 
Python :: autopytoexe 
Python :: discord py fetch message 
Python :: django admin.py 
Python :: pycord discord discordpy get total slash commands and total commands regestered in your bot 
Python :: python scipy moving average 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =