int([x[age1]])
You are attempting to access the age1 index of the x number here, which is illogical. Additionally, you are attempting to cast the result back to an integer after putting it in a list, which is not required.
Instead, use the int() function to immediately cast the age1 input text to an integer, as in the following example:
name1 = input("What's your name? ")
age1 = int(input("how old are you? "))
twentyone = 21 - age1
print("Hi, " + name1 + ", you will be 21 in: " + str(twentyone) + " years.")
After this, error will be terminated.
Master the art of Data Science with Python and unlock the power of insights.