def get_length(string):
length = 0
for char in string:
length += 1
return length
def find_larger_string(string1, string2):
length1 = get_length(string1)
length2 = get_length(string2)
if length1 > length2:
return string1
elif length2 > length1:
return string2
else:
return "Both strings are of equal length."
string1 = input("Enter the first string: ")
string2 = input("Enter the second string: ")
larger_string = find_larger_string(string1, string2)
print("Larger string:", larger_string)
#source code --> clcoding.com
0 Comments:
Post a Comment