Program - convert string to intern string


Topic: Program - convert string to intern string

Solution

def str_to_intern_str(a):
    import sys
    b = sys.intern(a)
    if a is b:
        print('Sentence is interned')
    else:
        raise ValueError('This should not happen')



List all Python Programs