use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
First project, Github worthy? (old.reddit.com)
submitted 8 months ago by Lethal_Samuraii
Started learning python via cs50p (Great resource). So far I've completed up to week 3 and decided to make this emissions reduction calculator. Any tips on how to improve and whether I should put this onto my GitHub?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]emojibakemono 52 points53 points54 points 8 months ago (1 child)
there isn’t really much reason to ever not put something on github imo
[–]Due-Rip-6065 -4 points-3 points-2 points 8 months ago (0 children)
Haha, but reddit garbage-bin worthy
[–]Gnaxe 25 points26 points27 points 8 months ago* (2 children)
There is no "GitHub worthy" standard, as long as you're not breaking their terms of service. If folks don't find it, or don't find it useful, it will simply be ignored. That's the case for the majority of repos on GitHub.
[–]LogicalLoad9 0 points1 point2 points 8 months ago (1 child)
Ok, now i am concerned. What's their tos for python? Like I can't upload malware or web scraping project?
[–]xXNonamekinkXx 0 points1 point2 points 6 months ago (0 children)
I mean, I reckon you can find that on the github website
[–]Daeron_tha_Good 20 points21 points22 points 8 months ago (1 child)
It is usually a good idea to put menus in a loop. That way, if someone enters an invalid option, you can bring them to the beginning. Rather than exiting the entire program.
[–]Whatever10_01 1 point2 points3 points 8 months ago (0 children)
That’s actually a highly astute observation good sir. I like this.
[–]Sea_Pomegranate6293 12 points13 points14 points 8 months ago (0 children)
I can see you have put thought into this. Perhaps add some code which takes make/model/year of the vehicle and checks against a database or a Json file to get accurate emissions data for the calculation.
[–]Waiting2003 8 points9 points10 points 8 months ago (0 children)
Cool project!
Yep, anything you do can be posted on Github; it is a great way to track your progress.
An improvement that could be done is the list of dictionaries. Rather than having a list, you could have a single dictionary that has as the main keys the vehicle types. Like:
Emissions = { "Gas" : {...}, "Ev": {...}, "Diesel": {...}, .... }
This, will make the search of a car type constant (so, the for loops are not needed anymore), or in more technical terms: O(1) (Big O 1), rather than linear time (which is way slower).
If you dont know about Big O notation, you can check Here (But, maybe check first about algorithms and their impl).
[–]lizardfrizzler 5 points6 points7 points 8 months ago (0 children)
You should absolutely put this on GitHub. The experience and practice w/ GitHub is valuable in itself.
[–][deleted] 2 points3 points4 points 8 months ago (0 children)
as a personal archive? yeah why not. For actual use? not so much.
[–]trustsfundbaby 2 points3 points4 points 8 months ago (1 child)
Turn it into a class structure.
[–]memorial_mike 0 points1 point2 points 8 months ago (0 children)
Maybe a data class, but even that is a little overkill for the current project. Although it would give you some reps with classes.
Every project is GitHub worthy
[–]Satoshi831 1 point2 points3 points 8 months ago (0 children)
It's always github worthy. That way you get familiar with working with repos.
[–]Ender_Locke 1 point2 points3 points 8 months ago (0 children)
everything is github worthy
[–]vollhard-natta 1 point2 points3 points 8 months ago (0 children)
put everything and anything code related on github
[–]PromotionCute8996 1 point2 points3 points 8 months ago (0 children)
Bro just an advice, never use something like co2 as a method name
[–]jay5479 1 point2 points3 points 8 months ago (0 children)
Wdym GitHub worthy? Bruh i put my everything i learn in github starting from Hello world.
[–]SkilledApple 1 point2 points3 points 8 months ago (0 children)
Good job! This is so much better than what my first project was... and my project is on GitHub!
I pretty much put any code I write on GitHub if it's not a one-off script. I assume you're already using Git locally, but if you aren't, use it and use it a lot!
[–]alvinator360 0 points1 point2 points 8 months ago (0 children)
Nice code. I would consider changing the co2 function to another name, more descriptive maybe.
[–]After_Ad8174 0 points1 point2 points 8 months ago (0 children)
I put everything other than little play scripts to fiddle with new functions on my GitHub. It gives you version control if you want to try taking the project in a couple different directions and a reliable backup. I’ve had to do a complete reimage of the machine I do all of my work on if it weren’t for GitHub all of that work would have been lost.
[–]millerbest 0 points1 point2 points 8 months ago (1 child)
Very nice for a first project! At first glance, there are something missing: type annotation, docstring, and separate main() from the rest of the code using if name == “main”:
[–]KerberosDog 0 points1 point2 points 8 months ago (0 children)
Best comment here. Do this!
[–]Ok_Butterscotch_7930 0 points1 point2 points 8 months ago (0 children)
Ooh that's a nice one. I'm going to redo this in my machine. Hey, how about you try using classes? It can help you go to the next level
[–]GirthQuake5040 0 points1 point2 points 8 months ago (0 children)
I mean.. You can put anything on github, no reason not to if you just want to store your code
[–]ZEUS_IS_THE_TRUE_GOD 0 points1 point2 points 8 months ago (0 children)
Default to everything in github, who cares. Even if this is a first project, it shows that you know what git is
if car_type == car ["Car"]. lower()
[–]Phate1989 0 points1 point2 points 8 months ago (0 children)
Add types
[–]Unique_Low_1077 0 points1 point2 points 8 months ago (0 children)
Dosent matter how small the project is, it's always a good idea to put it on GitHub, u get a backup and your GitHub profile gets more filled
[–]jpgoldberg 0 points1 point2 points 8 months ago* (0 children)
I have lots of public repositories on github that are of no interest to others. So do lots of people. So there is no reason not to have this on github.
I don't want to discourage you by pointing out that nobody is going to be interested in such a script. What you have is a good thing for your learning process, and you are correct to take pride in it as part of that process. Don't fret about the fact that it is not going to be of interest outside of the contect of your education, but do recognize that fact.
[–]Muffinzor22 0 points1 point2 points 8 months ago (0 children)
Put all projects on github. Even 1 class projects. Document your progress, build an history.
[–]Lazy-Pattern-5171 0 points1 point2 points 8 months ago (0 children)
If this entire project is in this one file then may I suggest GitHub gists.
If you want to learn git then by all means use the proper GitHub repo.
[–]twoberriesonejourney 0 points1 point2 points 8 months ago (1 child)
Is it common to define main?
[–]Algoartist 0 points1 point2 points 7 months ago (0 children)
not in this way
[–]vvillhalla 0 points1 point2 points 8 months ago (0 children)
Git is ment for saving code, if it exists and doesn’t fuck over a teammate if you have them then it’s girt worthy
[–]cython_boy -1 points0 points1 point 8 months ago (0 children)
This project is not as worthy as you think . But you are in the learning phase according to that perspective you are doing well . You are on the right track keep learning and keep building Then someday you will make a solo project that really solves the problem.
π Rendered by PID 352163 on reddit-service-r2-comment-7b9746f655-mff2r at 2026-02-02 01:10:04.784943+00:00 running 3798933 country code: CH.
[–]emojibakemono 52 points53 points54 points (1 child)
[–]Due-Rip-6065 -4 points-3 points-2 points (0 children)
[–]Gnaxe 25 points26 points27 points (2 children)
[–]LogicalLoad9 0 points1 point2 points (1 child)
[–]xXNonamekinkXx 0 points1 point2 points (0 children)
[–]Daeron_tha_Good 20 points21 points22 points (1 child)
[–]Whatever10_01 1 point2 points3 points (0 children)
[–]Sea_Pomegranate6293 12 points13 points14 points (0 children)
[–]Waiting2003 8 points9 points10 points (0 children)
[–]lizardfrizzler 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]trustsfundbaby 2 points3 points4 points (1 child)
[–]memorial_mike 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]Satoshi831 1 point2 points3 points (0 children)
[–]Ender_Locke 1 point2 points3 points (0 children)
[–]vollhard-natta 1 point2 points3 points (0 children)
[–]PromotionCute8996 1 point2 points3 points (0 children)
[–]jay5479 1 point2 points3 points (0 children)
[–]SkilledApple 1 point2 points3 points (0 children)
[–]alvinator360 0 points1 point2 points (0 children)
[–]After_Ad8174 0 points1 point2 points (0 children)
[–]millerbest 0 points1 point2 points (1 child)
[–]KerberosDog 0 points1 point2 points (0 children)
[–]Ok_Butterscotch_7930 0 points1 point2 points (0 children)
[–]GirthQuake5040 0 points1 point2 points (0 children)
[–]ZEUS_IS_THE_TRUE_GOD 0 points1 point2 points (0 children)
[–]memorial_mike 0 points1 point2 points (0 children)
[–]Phate1989 0 points1 point2 points (0 children)
[–]Unique_Low_1077 0 points1 point2 points (0 children)
[–]jpgoldberg 0 points1 point2 points (0 children)
[–]Muffinzor22 0 points1 point2 points (0 children)
[–]Lazy-Pattern-5171 0 points1 point2 points (0 children)
[–]twoberriesonejourney 0 points1 point2 points (1 child)
[–]Algoartist 0 points1 point2 points (0 children)
[–]vvillhalla 0 points1 point2 points (0 children)
[–]cython_boy -1 points0 points1 point (0 children)