This is my program:

def main():
    print('This is a program to calculate the setprod')
    print()
    userinput = input('Enter two sets separated by a comma: ')
    value1, value2 = userinput.split(',')
    mylist1 = eval(value1.strip())
    mylist2 = eval(value2.strip())
    print(mylist1 + mylist2)

main()

If I enter following:

>>> 
This is a program to calculate the setprod

Enter two sets separated by a comma: set([2]), set([3])

I get this error:
print(mylist1 + mylist2)
TypeError: unsupported operand type(s) for +: 'set' and 'set'

How do I fix this problem?

Never mind, I mixef up sets with lists

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.