Python program to take in two strings and print the larger string I have written a Python program to take in two strings and print the larger of the two strings.

Here is my code - 

string1 = input("Enter first string: ")
string2 = input("Enter second string: ")
count1 = 0
count2 = 0
for i in string1:
      count1 = count1 + 1

for j in string2:
      count2 = count2 + 1

if (count1 &lt; count2):
      print ("Larger string is:")
      print (string2)

elif (count1 == count2):
      print ("Both strings are equal.")
else:
      print ("Larger string is:")
      print (string1)


Here are some example outputs -

Enter first string: everything
Enter second string: nothing
Larger string is:
everything

Enter first string: cat
Enter second string: apple
Larger string is:
apple


I feel that my code is unnecessarily long. Therefore, I would like to know whether I could make this program shorter and more efficient.

Any help would be highly appreciated.
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!')