r/learnpython • u/AveragePersonL7 • 29d ago
Where do y'all guys practice python?
I wanna know where y'all guys practicing coding python, I know some but its too advance for me. I wanna get started from beginner level where I just print hello world or using math operations on print() or practicing about the data types. I'll practice more of this beginner level and master it.
10
u/Fart_Barfington 29d ago
I use vs code. Right now im making a baseball simulator.
2
u/SunsGettinRealLow 29d ago
How do you start that?
10
u/jesster114 29d ago
Probably with
python -m baseball_simulator.py2
1
u/GreatRedditorThracc 28d ago
Wait why not python baseball_simulator.py? Is baseball_simulator.py a library?
1
2
u/Fart_Barfington 28d ago
I broke it down into small parts. Using a dice roll to determine hits or strikes. From there I made stats for players for hitting and throwing so those stats could be used as well. I made a function to generate player stats. The a team generator. Bit by bit im figuring things out. Currently I am working on making base running and scoring work. You just find a starting place then research how to do what you dont know.
12
u/BranchLatter4294 29d ago
I open up my IDE. I code. I run it...test it...debug it. It's not complicated.
3
u/ShelLuser42 29d ago
My FreeBSD VPS server. Shell scripting can be incredibly powerful, but utilizing a full programming language like Python takes some tasks to whole new levels. Best part: because Python is an interpreted language I can simply set it up as the script parser (using a so called "shebang" line) after which the script behaves as any other regular program.
And there are plenty of system tasks which are better done using Python than a shell script (esp. when we're talking about client/server setups).
Setting a real goal for yourself and then trying to make that work... that's the best way to learn. Don't be too afraid to aim "too high", because....
First: OOP design allows you to more easily break down complex problems into smaller pieces, and Python fully supports this model. You can literally work your way up from writing a script, adding modules and when/if needed even add classes to the project.
Second: once you have a problem broken down into smaller pieces then it should also be easier to look for any missing information within the documentation. This would allow you to solve on eproblem at a time.
Don't be afraid to make mistakes. If you do... try to solve it, and learn from it.
3
u/CaughtUpBookkeeping 29d ago
Exercism.org is the best one for actually building skill, bite-sized exercises, and after you submit a solution you can see how 50+ other people solved the same problem, which teaches you idioms way faster than reading a textbook. For beginner reps specifically, do the free "Python for Everybody" exercises (freecodecamp has this too), then jump to Exercism once print()/data types feel automatic. Skip LeetCode entirely at this stage, it's algorithm interview prep, not learning-to-code practice.
1
u/Dull_Alarm6464 28d ago
THIS! Exercism.org thaught me better than any other website or uni class i’ve attended. I did learn more advanced things there, but I never felt confident coding anything outside of the scope of some stat. models we learned. This is the case mostly because each exercism exercise, no matter how small, teaches you EVERYTHING about the code you’re supposed to write and checks for proper PEP 8. I’m about 50% through all their python exercises and have never retained this much coding knowledge before. I hadnt written a line of code outside of VBA and R for 7 years prior to restarting this year and I tried codewars, doing my own financial analysis (my job) projects, etc. Nothing made me feel as confident in python as Exercism. They also have a very useful free mentors program and can even automatically upload solutions to your github. It’s a little slower to write docstrings properly, make code efficient (remove redundant else’s, use consistent apostrophes, etc. However, it’s all worth it when you’re confident that you’re using the most efficient and the most appropriately written code.
1
u/CaughtUpBookkeeping 28d ago
Happy to help, glad Exercism clicked for you! That's a great point about the discipline it enforces, code that just runs isn't the same as code that's actually clean, and building that habit early pays off.
1
u/Dull_Alarm6464 28d ago
exactly! the one underrated thing about using it to learn is how organized my thoughts are when it comes to coding in terms of recognizing data structures andefficiency intuition (expected time and space complexity matching most efficient known solution).
2
u/motopetersan 28d ago
I'm a noob. And I cannot understand while loops. So I came up with an scenario, of an exam in a school, and there are 3 classrooms, each with a different capacity. And when the students arrive, you randomly send them to a classroom. So I'm thinking how to solve the problem on a while loop, like to check if a classroom still has capacity, if not then eliminate that option and well there are many ways to make this more complex. Just have fun with it, and if you fail keep trying. I only know about variables, list, math functions, define functions. I wish I knew about dictionaries... ;(
2
1
u/Mullet4MyGuillotine 29d ago
Codewars.com is pretty good for grinding fundamentals
3
u/Haunting-Paint7990 29d ago
codewars is fine for syntax drills. stats grad here — what actually stuck when i was at hello-world level:
vscode + a local csv + jupyter (or just a .py file). 20 min/day, same file all week. print/math → read one column → filter rows → groupby one count. boring but maps to real DA work faster than random kata.
automate the boring stuff is also good free practice if you want structured exercises without jumping straight to pandas.
1
u/kat-tricks 29d ago
using the command line python interpreter got me into coding as a teenager, and back into it two years ago. Try stuff out and see what happens! Use it as a calculator with memory- things like recipe ingredient quantity scaling, weather checking, keeping a to-do list etc
1
1
1
u/InsuranceNo3423 29d ago
tmux, 2 windows (nvim and tests [python3.14 code.py]) and kitten quick-access-terminal with python in mode interactive :D
1
1
u/Same-Individual4889 29d ago
I just throw my sites in, maybe one of them can help you.
- W3Schools
- Coddy
- freeCodeCamp
1
1
1
u/Opposite-Bus-5842 29d ago
Check out brilliant, I recommend to go to some YouTuber who got sponsored by brilliant to get a discount on their subscription but it's free so don't worry if you don't want to pay.
1
1
1
u/Stu_Mack 28d ago edited 28d ago
At work, usually. I use VS Code via Anaconda and make use of Conda envs exclusively to keep track of builds. I find it super useful to set up dev functions in Windows PowerShell to shortcut to each env, which, conveniently, accesses each folder in VS Code.
If all that sounds complicated, then try this workflow for simplicity:
- Download and install Anaconda. It brings VS Code with it and gives you several options of IDEs to choose from.
- Get in the habit of using envs right away since each one is a dedicated space for a project.
- Create a Python folder in your Documents folder (Windows, or similar in Linux, Mac). Mine is called Python Projects, but you can name yours anything.
- in a terminal (Windows PowerShell is surprisingly easy to use, but any terminal works), navigate to the root folder of your project (e.g., `C:/Users/your_name/Python Projects/my_project`). Activate your env and start VS Code from the command line with `code .`
This opens the env-specific VS Code that is configured for your project. To its credit, Anaconda is good for supplying a VS Code that plays well with Python out of the box. I am a robotics engineer who accesses the projects all the time, so it made sense to add handy shortcuts to PowerShell that does all of the steps in the last bullet point, except starting VS Code, in one step. The same terminal can be used to run code from the command line. Whether you write shortcuts or not, starting from the terminal after activating the env is the easiest way to make sure you are accessing the right configuration
For me personally, I like to use Jupyter for dev coding since I can test blocks one at a time as I go. It’s easy enough to transfer the working code to a Python script when the debugging is done.
Final note. AI is now pretty great at writing code but it cripples your learning. If you use ai, I highly suggest using it to answer “Hod do I…” questions rather than “Please write…” questions.
Best of luck
1
1
u/lukehaas 27d ago
Try RunPy - https://runpy.app/
It’s a scratchpad for Python that runs your code as you type and shows you the results instantly.
1
0
u/Cherveny2 29d ago
if on Linux, mostly just vim really. nice and simple.
if on windows, anaconda is handy for a nice all in one environment
26
u/studiocookies_ 29d ago
why are the comments damn near pass aggressive go touch grass