cows = ["aaa","aab","aac","aad","aae","aaf","aag","aah","aai"]
h = ["aaa","aab","aac","aad","aae","aaf","aag","aah","aai"]
test1 = []
day1 = []
day2 = []
day3 = []
day4 = []
day5 = []
day6 = []
day7 = []
aaa = []
days = ["Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7"]
w = ["Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7"]
print("Here are your cows :")
print(h)
print("You will need to input the total liters the cow has milked during the day starting from cow aaa to aai.")
for x in range(7):
print(days[0], end = " ")
days.pop(0)
cows = h[0:9]
for x in range(9):
print("Cow : ", cows[0])
test1.append(float(input("How many liters did you milk the cow? ")))
cows.pop(0)
aaa = test1
for x in range(8):
aaa.pop(1)
for x in range(8):
aaa.pop(2)
for x in range(8):
aaa.pop(3)
for x in range(8):
aaa.pop(4)
for x in range(8):
aaa.pop(5)
for x in range(8):
aaa.pop(6)
for x in range(8):
aaa.pop(7)
コードが実行され、すべてのデータが入力されたとき。私は試してリストをチェックしますコピーリストはコードを変更しますか?
>>> aaa
[20.0, 1.0, 20.0, 20.0, 20.0, 20.0, 20.0]
しかし、私はtest1を入力すると、これが発生します。
>>> test1
[20.0, 1.0, 20.0, 20.0, 20.0, 20.0, 20.0]
私はリストに何か間違っていますか?リストtest1を別のリスト "この場合はaaa"にコピーすることができますが、aaaからリストの一部を削除しようとすると、それもtest1から削除されます!