You fretting about this now will save you from heaps of stress and trouble in the future.
You’re starting high school later this year, so unless you’re on an accelerated math track you’re only at the tip of the iceberg when it comes to the world of math. Struggling with math and failing tests can be solved by reconsidering your approach towards math overall and your study habits.
Do you consider yourself an “Art Person” more than a “Math Person”? If so, get rid of the idea that such a divide exists. Unless you have something like discalculia, you are perfectly capable of understanding math and excelling in it! You will not be able to major or succeed in CompSci if you are stuck with this mindset.
http://www.theatlantic.com/education/archive/2013/10/the-myth-of-im-bad-at-math/280914/
http://www.quickanddirtytips.com/education/math/you-are-not-bad-at-math
http://ww2.kqed.org/mindshift/2015/11/30/not-a-math-person-how-to-remove-obstacles-to-learning-math/
There are excellent resources such as KhanAcademy in order to help you with catching up mathematics. I recommend starting in PreAlgebra and working your way up. (with regards to your interest in coding, I recommend codecademy. Start with something simple, like javascript.)
I used to suck at math, too, but now I’m making 100s every grading period and acing every test, final, and assignment. If it’s possible for me, it’s possible for you! 
If you’re fine with being eh at math then disregard all of the above.
I’m unsure about how much Sweden will care about your proficiency in math. However, I do have a feeling that they’d want an international applicant to either be on par or exceeding the average Swede when it comes to Math/Reading, and Sweden’s national average PISA Math/Reading scores dived down 2012, so you’d probably do alright.
Though, I have to ask, how much research have you done on being an international student in Sweden? Do you know if there are Swedish proficiency tests that you will need to pass? Do you know if you will need to apply for a visa? Will the country or program you apply to have housing and other accommodations for you? Will Sweden CARE about your SAT and ACT scores? I found a few links that may help you.
https://studyinsweden.se/how-to-apply/
https://sweden.se/society/higher-education-and-research/
http://www.thecompleteuniversityguide.co.uk/international/europe/sweden/
http://www.studying-in-sweden.com/
This response was really long because I see a lot of myself in you. In fact, our interests seem to be eerily similar. I too at your age desired to move and study in Sweden, and possibly major in Art or maybe even CompSci. I also really loved Gravity Falls and writing. However, I overlooked a lot of things and I didn’t really try or care about all of this stuff going into Freshman year. I wish you the best of luck with starting high school! Make it count. 