python题编写一个程序,接收用户的输入并存入一个列表,再编写一个函数,将用户的输入列表作为参数,

2025-02-02 00:44:25
推荐回答(1个)
回答1:

L = []
while 1:
    s = input('Please input your information:')
    if s == ' ':
        break
    else:
        L.append(s)


def funcrepeat(L):
    if list(set(L)) == L:
        print("你的输入没有重复值")
    else:
        print("你的输入有重复值")
    print(L)


funcrepeat(L)