TypeError: list indices must be integers or slices, not tuple
# Python Accessing List
numbers=[1,2,3,4]
print(numbers[0,3])
TypeError: list indices must be integers or slices, not tuple
# Python Accessing List
numbers=[1,2,3,4]
print(numbers[0,3])
TypeError: list indices must be integers or slices, not builtin_function_or_method
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
ordinalNumbers = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st']
# Get Date
def getDate():
now = datetime.datetime.now()
my_date = datetime.datetime.today()
weekday = calendar.day_name[my_date.weekday]
monthNum = now.month
dayNum = now.day
return ('Todays date is '+weekday+' '+months[monthNum -1]+' the '+ordinalNumbers[dayNum -1]+'.')
print(getDate())
TypeError: list indices must be integers or slices, not tuple
# Python Accessing List
numbers=[1,2,3,4]
print(numbers[0:3])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us