返回不重复练习

"""

定义函数,返回字符串中第一个不重复的字符。

输入:AABCCDBEFD

输出:E

"""

def not_repeated(target_str):

    for i in target_str:

        count = 0

        for r in target_str:

            if i == r:

                count += 1

        if count == 1:

            return i

str01 = “AABCCDBEFD”

print(not_repeated(str01))