سلام
جواب تمرین common prefix درسته ؟
def find_common_prefix(strings): common_prefix = "" common_founded = False for i in range(len(min(strings))): char = None is_char_common = True for string in strings: if char == None: char = string[i] elif char != string[i]: is_char_common = False common_founded = True break if common_founded : break common_prefix += strings[0][i] if is_char_common else "" return common_prefix