0
Все остальное в моем коде работает, но каждый раз, когда он просит добавить новый элемент в список, python также возвращает «None». Я пытаюсь избавиться от этого, любая помощь будет оценили.Python return 'None'
Это мой код:
#Welcome
name = input("What is your name? ")
print("Welcome %s to your shopping list" %name)
#Adding to the list
shoppingList = []
while True:
new_item = input(print("Please enter an item of your shopping list and type END when you have entered all of your items: "))
if new_item == "END": break
shoppingList.append(new_item)
length = len(shoppingList)
print("Your shopping list is", length, "item(s) long.")
shoppingList.sort
print("This is your list: ", shoppingList)
#Prompting the user to change list if necessary
change = input(print("Is there anything you wish to change?"))
if 'No' in change: print("Great.")
else:
delete = input(print("Which item would you like to replace?"))
shoppingList.remove(delete)
replace = input(print("What would you like to replace it with?"))
shoppingList.append(replace)
print("This is your new list: ", shoppingList)
Спасибо, много помогли! –