So i am in class for Python 1. Not we have 4 lists, all lists are in strings. I need to request a state input from a user and then find the index of that state and print the congressional districts, the order that state joined the union and the capital of that state, now i can get the index of the state which matches the index of the other 3 lists but i cant seem to print the str of that index number. Any idea what im doing wrong i always get the following error.
, line 225, in <module>
print(joined.index())
AttributeError: 'int' object has no attribute 'index'
here is the full code i currently have
state =[
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
'Idaho',
'Illinois',
'Indiana',
'Iowa',
'Kansas',
'Kentucky',
'Louisiana',
'Maine',
'Maryland',
'Massachusetts',
'Michigan',
'Minnesota',
'Mississippi',
'Missouri',
'Montana',
'Nebraska',
'Nevada',
'New Hampshire',
'New Jersey',
'New Mexico',
'New York',
'North Carolina',
'North Dakota',
'Ohio',
'Oklahoma',
'Oregon',
'Pennsylvania',
'Rhode Island',
'South Carolina',
'South Dakota',
'Tennessee',
'Texas',
'Utah',
'Vermont',
'Virginia',
'Washington',
'West Virginia',
'Wisconsin',
'Wyoming'
]
capital =[
'Montgomery',
'Juneau',
'Phoenix',
'Little Rock',
'Sacramento',
'Denver',
'Hartford',
'Dover',
'Tallahassee',
'Atlanta',
'Honolulu',
'Boise',
'Springfield',
'Indianapolis',
'Des Moines',
'Topeka',
'Frankfort',
'Baton Rouge',
'Augusta',
'Annapolis',
'Boston',
'Lansing',
'St. Paul',
'Jackson',
'Jefferson City',
'Helena',
'Lincoln',
'Carson City',
'Concord',
'Trenton',
'Santa Fe',
'Albany',
'Raleigh',
'Bismarck',
'Columbus',
'Oklahoma City',
'Salem',
'Harrisburg',
'Providence',
'Columbia',
'Pierre',
'Nashville',
'Austin',
'Salt Lake City',
'Montpelier',
'Richmond',
'Olympia',
'Charleston',
'Madison',
'Cheyenne'
]
districts =[
'7',
'1',
'8',
'4',
'53',
'7',
'5',
'1',
'25',
'13',
'2',
'2',
'19',
'9',
'5',
'4',
'6',
'7',
'2',
'8',
'10',
'15',
'8',
'4',
'9',
'1',
'3',
'3',
'2',
'13',
'3',
'29',
'13',
'1',
'18',
'5',
'5',
'19',
'2',
'6',
'1',
'9',
'32',
'3',
'1',
'11',
'9',
'3',
'8',
'1',
]
joined =[
'22',
'49',
'48',
'25',
'31',
'38',
'5',
'1',
'27',
'4',
'50',
'43',
'21',
'19',
'29',
'34',
'15',
'18',
'23',
'7',
'6',
'26',
'32',
'20',
'24',
'41',
'37',
'36',
'9',
'3',
'47',
'11',
'12',
'39',
'17',
'46',
'33',
'2',
'13',
'8',
'40',
'16',
'28',
'45',
'14',
'10',
'42',
'35',
'30',
'44'
]
user_state = input('Please enter the State you would like info about: ')
index = state.index(user_state)
joined = index
print(joined.index())