TypeError: Das Objekt „Funktion“ kann nicht abonniert werden – PythonPython

Python-Programme
Anonymous
 TypeError: Das Objekt „Funktion“ kann nicht abonniert werden – Python

Post by Anonymous »

Ich habe diesen Code:

Code: Select all

bank_holiday= [1, 0, 1, 1, 2, 0, 0, 1, 0, 0, 0, 2] #gives the list of bank holidays in each month

def bank_holiday(month):
month -= 1 # Takes away the numbers from the months, as months start at 1 (January) not at 0. There is no 0 month.
print(bank_holiday[month])

bank_holiday(int(input("Which month would you like to check out: ")))
Aber wenn ich es ausführe, erhalte ich die Fehlermeldung „TypeError: ‚function‘ object is not subscriptable.“ Warum?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post