Write a program to check whether a given string is Heterogram or not
Topic: Write a program to check whether a given string is Heterogram or not
Solution
def heterogram(input): alphabets = [ ch for ch in input if ( ord(ch) >= ord('a') and ord(ch) <= ord('z') )] if len(set(alphabets))==len(alphabets): print ('Yes') else: print ('No') if __name__ == "__main__": input = 'Hello World' heterogram(input)
List all Python Programs