A quick language learning program I made.
shape_warrior_t @ shape_warrior_t @programming.dev Posts 4Comments 10Joined 1 mo. ago
shape_warrior_t @ shape_warrior_t @programming.dev
Posts
4
Comments
10
Joined
1 mo. ago
Nice! Some feedback (on your Python, I don't speak Greek):
snake_case
-- for example,greekTranslation
should begreek_translation
. (EDIT after seeing your most recent reply: good luck with that when it comes to Python :) )reverseTranslation
every time the user requests an English-to-Greek translation. Unless you're planning to modifygreekTranslation
while the program is running, it would likely be more efficient to makereverseTranslation
a global variable, computed just once at the start of the program.while optionSelection == <'practice'/'translation'>
makes it look likeoptionSelection
could change to something else inside the loop, yet you never do so. You could just writewhile True
instead.else
branch to the mainif
-elif
-elif
chain. That way, if you added in a new option, you would only have one place in the code to modify instead of two. (Also, instead ofx != a and x != b and x != c
, you could writex not in [a, b, c]
).if
-elif
-elif
chain, you could replace it with amatch
statement, which would remove the repetitions ofoptionSelection ==
.Here's how I would write the control flow for the last section:
(You could probably pull the
while True
loops into their own dedicated functions, actually.)Hope that helps. Feel free to ask if any of this doesn't make sense.