#Given the user inputs, complete a program that does the following tasks: 

#Define a set, fruits, containing the user inputs: my_fruit1, my_fruit2, and my_fruit3 

#Add the user inputs, your_fruit1 and your_fruit2, to fruits 

#Add your_fruit1 to fruits 

#Remove my_fruit1 from fruits 

#Observe the output of each print statement carefully to understand what was done by each task of the program 

# Note: For testing purposes, sets are printed using sorted() for comparison, as in the book's examples 

#Ex if the input is: 
# apple 
# peach 
#lemon 
#apple
#pear 
#plum 

#The output is 
#['apple', 'lemon', 'peach']
#['apple', 'lemon', 'peach', 'pear']
#['apple', 'lemon', 'peach', 'pear', 'plum']
#['apple', 'lemon', 'peach', 'pear', 'plum']
#['lemon', 'peach', 'pear', 'plum']

my_fruit1 = input()
my_fruit2 = input()
my_fruit3 = input()

your_fruit1 = input()
your_fruit2 = input()

fruits = [my_fruit1, my_fruit2, my_fruit3]
fruits.sort()
print(fruits)

#add user input your_fruit1 
if your_fruit1 not in fruits: 
    fruits.append(your_fruit1)
    
if your_fruit2 not in fruits:
    fruits.append(your_fruit2)
fruits.sort()
print(fruits)

if their_fruit not in fruits:
    fruits.append(their_fruit)
fruits.sort()
print(fruits)

# add your_fruit1 to fruits (since they are already added in, to eliminate duplicates we just print what we have)
print(fruits)

#Remove my_fruit1 from fruits
if my_fruit1 in fruits: 
    remove(my_fruit1)
fruits.sort()
print(fruits)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: