Question: 
Write a function to find out the second most repeated (or frequent) string in the given sequence.


Model's Code:
def second_frequent(strings):
    from collections import Counter
    counts = Counter(strings)
    if len(counts) < 2:
        return None
    return sorted(counts, key=counts.get)[-2]



Sample Correct Code:
from collections import Counter 
	
def second_frequent(input): 
	dict = Counter(input) 
	value = sorted(dict.values(), reverse=True)  
	second_large = value[1] 
	for (key, val) in dict.items(): 
		if val == second_large: 
			return (key) 


Asserts:
assert second_frequent(['aaa','bbb','ccc','bbb','aaa','aaa']) == 'bbb'
assert second_frequent(['abc','bcd','abc','bcd','bcd','bcd']) == 'abc'
assert second_frequent(['cdma','gsm','hspa','gsm','cdma','cdma']) == 'gsm'


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 829 of 974: 635/829 (76.59831121833534%): success