Skip to content
← Back to Community
7.2.6
Profile icon
ariely122

def list2():
str1 = input("enter a list of Ingredients: ")
digit1 = int(input("enter a digit between 1-9: "))
list1 = str1.split(',')
count2 = 0
count3 = 0
while(digit1 != 9):
if(digit1 ==1):
print(list1)
elif(digit1 ==2):
len1 = len(list1)
print(len1)
elif(digit1 == 3):
ingrediends1 = input("enter a specific ingrediend")
if(ingrediends1 in list1):
print(True)
elif(digit1 == 4):
ingrediends2 = input("enter a specific ingrediend")
if(ingrediends2 in list1):
count2 = list1.count1(ingrediends2)
print(count2)
elif(digit1 == 5):
ingrediends3 = input("enter a specific ingrediend")
list1.remove(ingrediends3)
elif(digit1 == 6):
ingrediends4 = input("enter a specific ingrediend")
list1.append(ingrediends4)
elif(digit1 == 7):
ingrediends5 = input("enter a specific ingrediend")
if(len(ingrediends5) <3 or ingrediends5.isalpha() == False):
count3+=1
print(count3)
elif(digit1 == 8):
i=0
while(i<len(list1)):
if(list1.count(list1[i]) > 1):
list1.remove(list1[i])
i-=1
i+=1
digit1 = int(input("enter a digit between 1-9: "))
list2()

Voters
Profile icon
ariely122