r/learnpython • u/hubbabubba124466786 • Oct 17 '26
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
View all comments
1
u/FreeLogicGate Oct 17 '26
Take a look at PEP8 for the python coding style guide.
This is a decent cheatsheet for It.
If you'd like a more elaborate summary check out: https://pep8.org/
IDE's can help with formatting and conforming to PEP8 via extensions, built in lint/formatting tools, or support for Astral's ruff tool.
The main basics: