John's age is seventeen years less than twice Isabella's age. Together, the sum of their ages is 40. How old is John?

I did x+(2x-17)=40 I got x=19 but it keeps saying i got it wrong can you please help.

Hard to tell, since you did not define your x

I will let Isabella's age be x years
then John is 2x - 17

x + 2x-17 = 40
3x = 57
x = 19

So Isabella is 19, but it asked for John's age.
John is 2(19) - 17 = 21