I used the link that you provided and it seems like they offer the programming languages "python" and "python3". My assumption is that you are using "python", which is a version that doesn't support f-strings. (It seems f-strings were added in 3.6).
Also, the question in the link you sent expects a return type of an int, not a string. FYI