0
How can I make a program that add and edit but cant add or edit if its already in the list
Ex: import module_MFM_operation C=0 while c != 'Y': print("Food Menu") print("[A] add food") print("[E] edit food") c=input("Enter your Choice:") c = module_MFM_operation.ope(c) import myra_add,myra_edit foodlist=[] def ope(ch): if ch == 'A': c = myra_add.add_1(foodlist) fruitlist.append(c) elif ch == 'E': myra_edit.edit_2(foodlist) else: print("\nInvalid Input\n") But this time using color
2 Respostas
+ 2
#Something like this
num_list=[0,1,2,3,4,5]
for each in range(0,10):
if each not in num_list:
num_list.append(each)
else:
pass
print(num_list)
#also, I am not Filipino, sorry
0
So you want to use a Hashset?