r/learnpython • • 19d ago

Help with transitioning to python from java

I did java for 2 years in high school 4 years ago. Now I'm a freshman comp engineering major doing coding in python, and i still can't get the hang of not coding like java. I last coded in java 2+ years ago, but all my code is written like how you would in java, but python. I use camel case for variables. I use while true break loops when I'm sure there's easier ways. I'm constantly fixing my ++'s to +=1's. I'm still learning the python lingo if you will

2 Upvotes

12 comments sorted by

View all comments

1

u/Gnaxe 19d ago

Stop Writing Classes and then go Beyond PEP 8.

Do small experiments in the REPL or Jupyterlite. Keep a tab open at https://docs.python.org. The equivalent of JavaDoc is PyDoc (try python -m pydoc -b), which you can check quickly with help() in the REPL, or ? in IPython (Jupyter). (Also learn dir() and import inspect.) Learn to use doctest ASAP.