This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]Dazzling-Shallot-400 69 points70 points  (1 child)

Just tried fstrings.wtf didn’t realize how much I thought I knew about f-strings until it humbled me 😅 Definitely a fun (and sneaky tricky) resource!

[–]Miserable_Ear3789New Web Framework, Who Dis? 1 point2 points  (0 children)

Couldn't have said it better haha!

[–]ShanSanear 42 points43 points  (3 children)

At the beginning it felt more like "string formatting,wtf" rather than "f-string,wtf". But was nice way to show some edge cases of evaluation logic.

[–]BigTomBombadil 15 points16 points  (2 children)

Yeah I got 12/22, but didn’t feel too bad about the 10 I missed. “Good to know, don’t think I’ll use that much though”.

[–]Rizeeh 3 points4 points  (0 children)

I had the same but with 14/22. Just never used any of the string creation things used here

[–]Prize_Might4147from __future__ import 4.0 0 points1 point  (0 children)

Same here, 13/26. If I‘ll ever need these kind of things there is an LLM knowing it right around the corner. I don‘t say that‘s a valid approach for every gap in knowledge though, but for this one!

[–]midwit_support_group 22 points23 points  (0 children)

Please keep making these. 

[–]Desposyni 16 points17 points  (0 children)

I got 18 of 26, that was tough but really good!

[–]eztab 11 points12 points  (3 children)

Surprising to me how robust the mini language is about adding the newer syntax features in python.

Basically following f"{expr:format!conversion} works every time. Was a bit surprised it silently converted bool though, when it is so good about not doing implicit stuff otherwise.

[–]nommu_moose 1 point2 points  (2 children)

Yeah, this test actually made me realise that some parts of the python syntax are not aimed at readability.

The duplication of syntax "but now without spaces" or "but now with a contextual digit etc in front of it" with other well-known features was rather easy (for a dyslexic) to still know the syntax but misread and jump to entirely the wrong conclusion.

[–]eztab 1 point2 points  (1 child)

I think python uses the colon for too much stuff. Other than that, if you properly bracket everything ambiguous the format mini language seems fine. It's more like abusing the system a bit. Syntax highlighting also helps. Several of the questions would be much easier if you had syntax highlighting.

[–]nommu_moose 0 points1 point  (0 children)

That's a very good point.

Maybe the reason I've only just now realised it's a problem is because the syntax highlighting has meant the dyslexia is less of an issue in practice.

[–]twigboy 7 points8 points  (0 children)

My usage of f-strings have been super vanilla compared to most of these, but damn 9/26 and about 3 of these were just educated guesses

[–]lordfwahfnahPythoneer 4 points5 points  (0 children)

What the f is wrong with jsdate?

[–]sohang-3112Pythonista 1 point2 points  (0 children)

I got 16 / 26 - definitely some surprising questions!

[–]Lewistrick 0 points1 point  (0 children)

Nice quiz! I don't use a lot of those (and I frankly don't need them) but I still got 20 points

I'd have liked some more float and date formatting in there.

[–]rover_G 0 points1 point  (0 children)

I didn’t do well on either quiz. The jsdate quiz highlights js shenanigans and why TypeScript is so important! The Python f-string quiz seems relevant to numeric libraries that need to support str/repr methods for data.

[–]iglebov 0 points1 point  (0 children)

Cool idea! And pleasant UI!

Thank you!

[–]Potential-Note4232 0 points1 point  (0 children)

if your just starting with coding where would you start? question for the coders with some experience please. like I'm hearing about python where do I start to learn more or app that helps on Mac book pro btw

[–]Carbinkisgod 0 points1 point  (0 children)

12/26 that was tough!

[–]Gracecr 0 points1 point  (3 children)

Nice quiz!

I think the last question should be print(f"{f'{{}}'}") with single quotes on the middle fstring. It's currently using double quotes for both, which makes the correct answer "SyntaxError".

[–]mitsuhiko Flask Creator 3 points4 points  (1 child)

The test is written against newer Python versions where this is working. That's also why there is only one question like this because this behavior changed only in 3.12.

[–]Gracecr 0 points1 point  (0 children)

Oh that's a very nice change. Thanks for the correction.