HTML + JS + Python = hard

Medea - May 3 '22 - - Dev Community

So I’m going to make a game in Python where you hear chords/notes and you have to figure out what note it is.

I’ve already written the script for creating the note sounds, and I’ll probably save all the notes to a audio file each.

For the rules, I’ll give one minute to the user to do as many notes as they can do.

But the game will be rendered via HTML, and I’ll be saving best scores and stats in Python, so how will I connect them together?

I was thinking of doing the counting in JavaScript, choosing the random note in JavaScript, and save the score for the round in JavaScript via cookies. Then when the game ended, I could redirect to a url with the score so I could do the function in that url.
But that isn’t the best solution as that way anyone can go to the url and change their score, or they can use the console to change the cookie data anyways.
Is there a more secure way of doing this?
Thanks

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .