def double_char(str): new_string = '' for letter in str: new_string += letter*2 return new_stringdef count_hi(str): return str.count('hi')def cat_dog(str): return str.count('cat') == str.count('dog')def count_code(str): count = 0 words = ['co'+x+'e' for x in 'abcdefghijklmnopqrstuvwxyz'] for word in words: numbers = str.count(word) count += numbers return countdef end_other(a, b): a,b = a.lower(),b.lower() if a.endswith(b) or b.endswith(a): return True return Falsedef xyz_there(str): a,b = str.count('xyz'),str.count('.xyz') if a!=b: return True return False