-4
pitch = input('Please enter the pitch of the note: ')
pitch = int(pitch)
time = input('Please enter the duration of the pitch in seconds: ')
time = int(time)
event 1 = [music[-1][0], pitch, 'On'] # when I run this error occurs here, event 1.
event 2 = [music[-1][0]+ time, pitch, 'Off']
music.append(event 1)
music.append(event 2)
print(music)
displaymusic()
如何修復錯誤?這是將音符添加到音樂列表的代碼。將某些內容添加到列表中的代碼
**什麼**錯誤需要修復?並且請不要在問題中使用全部大寫,不需要大聲呼喊。 –
無論您使用過什麼「事件1」和「事件2」,都是非法語法。 –