human
Check if the string contains consecutive letters and each letter occurs exactly once | Function to check if the condition holds.
Get the length of the string.
sort the given string.
Iterate for every index and check for the condition.
If are not consecutive.
Driver code.
1 st example.
2 nd example"
How can the above be solved in Python?

Can you provide a code to check if the string contains consecutive letters and each letter occurs exactly once and the other steps required?
assistant
#Here is code to check if the string contains consecutive letters and each letter occurs exactly once and the other steps required.
 def check ( s ) :
	l = len ( s )
	s = ' ' . join ( sorted ( s ) )
	for i in range ( 1 , l ) :
		if ord ( s [ i ] ) - ord ( s [ i - 1 ] ) != 1 :
			return False
	return True
if __name__ == " _ _ main _ _ " :
	string = " dcef "
	if check ( string ) :
		print ( " Yes " )
	else :
		print ( " No " )
	string = " xyza "
	if check ( string ) :
		print ( " Yes " )
	else :
		print ( " No " )