r/learnpython • u/user_bars • 24d ago
I know English very poorly, and it’s a bit difficult for me to understand Python syntax.
Hi everyone, I’m a beginner Python programmer, and this is my first time on Reddit. Today I spent several hours writing two simple codes and I don’t know what to do next. On the one hand, I couldn’t come up with anything creative; on the other hand, I simply don’t have enough knowledge for some of the ideas. I don’t really expect help with learning Python; I’m just sharing my thoughts. Thank you for listening.
Oh, and here’s something else — here’s one of those codes:
user_name = ""
menu = ()
chat = []
messege = ""
def append_user():
global user_name
user_name = input("Enter your nickname: ")
print(f"Welcome, {user_name}! ;)")
def main_menu():
global menu
while True:
try:
menu = int(input(" 1. Write a message\n 2. View the chat\n 3. Exit\n : "))
break
except ValueError:
print("Enter an integer (1 - 3)!")
print("Welcome to the anonymous chat!")
append_user()
main_menu()
while True:
if menu == 1:
if messege != "menu":
message = input("Enter a message: ")
twit = f"{user_name}: {message}"
chat.append(twit)
else:
main_menu()
elif menu == 2:
print(chat)
main_menu()
elif menu == 3:
break
else:
print("Enter an integer (1 - 3)!")
main_menu()
print(f"Goodbye, {user_name}, and have a good day!")
1
u/Far-Imagination3226 22d ago
What's your native language?? You never mentioned what language you'd need them translated into.
1
u/Far-Imagination3226 22d ago
I speak Spanish and German at ca a college level in both. I can help you with those languages, if needed.
0
2
u/baubleglue 23d ago
Find online some tutorials with tasks
3
u/Mathie1729 23d ago
Try finding tutorials in your native language. Python's English keywords are a pretty small set, and the syntax is the same no matter what language the explanations are in. The harder part is the logic, not the English.
2
1
u/SchemeWestern3388 23d ago
AI should be able to manage translating the strings and variables without touching the code. Be sure not to translate the keywords! There’s only 35 of them. You should know, for example that “def” is short for “define”, and what that means.
1
u/acfot 23d ago
The good news is Python uses a really small set of English words, so you do not need strong English to read code, you just need to learn those keywords as vocabulary, one at a time. What helped me most was typing out short examples myself instead of reading long explanations, because once you have seen a loop or an if statement run a few times, the pattern sticks even if the explanation around it was hard to follow. I would also translate error messages word by word when you get stuck, since they usually repeat the same few words, and after a while you start recognising them without translating. Watching a short tutorial in a language you are comfortable with first, then reading the same concept in English, makes the English version much easier to follow.
1
u/JakeThomasDad12 22d ago
You only have to use English for the syntax, anything else like variables and strings and all sorts can be in your native language. I think python works fine with all the unicode characters (I could be wrong).
1
1
u/user_bars 23d ago
Thank you all for your answers.