Python program to take in two strings and print the larger string
Python strings supports Python built-in len function. You don't need to iterate through them manually, as for lists/dicts/sets etc (it is not Pythonic):

def compare_strings_len(s1, s2):
    if len(s1) &gt; len(s2):
        print('String 1 is longer: ', s1)
    elif len(s1) &lt; len(s2):
        print('String 2 is longer: ', s2)
    else:
        print('Strings length are equal!')