Q:

Syntax Error- Highlights a variable Python

I'm a beginner at coding in Python. I am writing this code that is supposed to let the user see the World's population information in a couple of tables and then a couple of options are just sentences with the highest, and lowest male to female ratio, etc.
I have come across and fixed multiple errors. This last error that I can not seem to fix is just a syntax error, but I can not figure out what is wrong. It pops up a box that says syntax error and highlights my local variable, bothSexes_total. The option shown prints a table. 
def main():
    print("Welcome user.") #greetings
    Ages0_14= open("Ages0-14.txt", "r") #open files needed
    Ages15_64= open("Ages15-64.txt", "r")
    Ages65= open("Ages65.txt", "r")
    countries, males0_14, females0_14= get_lists(Ages0_14) #makes 3 lists from 1st file
    empty, males15_64, females15_64= get_lists(Ages15_64) #2 lists from 2nd file
    empty2, males65, females65= get_lists(Ages65) #2 lists from 3rd file
    print_menu()
    choice= input("Type the letter of the choice you would like to make.") #user makes choice

    if choice== "A" or choice== "a": #option a: display country's information
        country_input= input("Choose a country you would like to know the population information of.")
        country=(countries.index(country_input) #find index of country

        # I get an error here:
        bothSexes_total=(int(females0_14[country])+ int(females15_64[country])+ int(females65[country])+ int(males0_14[country])+ int(males15_64[country])+ int(males65[country]))
            male_total=(males0_14[country]+ males15_64[country]+ males65[country]) #male total from all ages
            female_total=(females0_14[country]+ females15_64[country]+ females65[country]) #female total from all ages
            both0_14=(int(males0_14[country])+ int(females0_14[country])) #total of both sexes from 1st file
            both15_64=(int(males15_64[country])+ int(females15_64[country])) #total of both sexes from 2nd file
            both65=(int(males65[country])+ int(females65[country])) #total of both sexes from 3rd file
            print(format("Country","20s")+ format("Age","20s")+ format("Both Sexes","20s")+ format("Male","20s")+ format("Female","20s")+ format("%Both","20s")+ format("%Male","20s")+ format("%Female","20s")+ format("Male to Female Ratio","20s")) #headers
                                    #name                   age                     both sexes             males                              females                                  %both
            print(format(countries[country], "20s")+ format("Total","20s")+ format(bothSexes_total, "20d")+ format(male_total, "20d")+ format(female_total, "20d")+ format(100, "20d")+ format(100, "20d")+ format(100, "20d")+ format(male_total/ female_total) #total age groups                                                 %males                        %females                                                 ratio
            print(format(countries[country], "20s")+ format("0-14","20s")+ format(both0_14, "<20d")+ format(males0_14[country], "<20d")+ format(females0_14[country], "<20d")+ format(males0_14[country]+ females0_14[country])/totalSexes_both, "<20d")+ format((males0_14[country])/male_total, "<20d")+ format((females0_14[country])/female_total, "<20d")+ format((male0_14/female0_14)*100, "20d") #1st file
            print(format(countries[country], "20s")+ format("15-64","20s")+ format(both15_64, "<20d")+ format(males15_64[country], "<20d")+ format(females0_14[country], "<20d")+ format(males15_64[country]+ females15_64[country])/totalSexes_both, "<20d")+ format((males15_64[country])/male_total, "<20d")+ format((females15_64[country])/female_total, "<20d")+ format((male15_64/female15_64)*100, "20d") #2nd file
            print(format(countries[country], "20s")+ format("64+", "20s")+ format(both65, "<20d")+ format(males65[country], "<20d")+ format(females65[country], "<20d")+ format(males65[country]+ females65[country])/totalSexes_both, "<20d")+ format((males0_14[country])/male_total, "<20d")+ format((females0_14[country])/female_total, "<20d")+ format((male65/female65)*100, "20d") #3rd file

A:

You forgot to close your parens on the previous line.

