Python program to compare strings using interning


Topic: Python program to compare strings using interning

Solution

import sys
def compare_using_interning(n):
    a = sys.intern('a long string that is not intered' * 200)
    b = sys.intern('a long string that is not intered' * 200)
    for i in range(n):
        if a is b:
            pass



List all Python Programs