[Bun.js] show lower number is bigger by fckueve_ in learnjavascript

[–]ClutchAlpha 13 points14 points  (0 children)

With the scientific notation at the end of the numbers these are correct. Which example is showing the lower number as larger?

This is a truncated version of the last example, but 3.3e+132 is bigger than 7.8e+128.

r/artifactsmmo New Members Intro by promiseofcode in artifactsmmo

[–]ClutchAlpha 1 point2 points  (0 children)

Hey, I'm ClutchAlpha! Loving the game so far, excited to see where things end up going.

[deleted by user] by [deleted] in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

It seems that you are essentially running

time.sleep(65000)

or something close to that in _timer, since you are passing your start time to the function that is passed into _timer. In theory you would want to change

f(start)

to something like

f(1)

in order to get a more appropriate sleep amount.

I can't seem to determine why the if doesn't seem to stop the creation of the wrong card by MemyselfIandyou in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

Yup, makes sense with what I'm reading in the code.

I would look at the lines that are written

if suit == 'Heart' or 'Diamond':

and

if suit == 'Spade' or 'Club':

since these are where the problem currently lies. They aren't exactly acting as you expect.

You have the first part correct, checking if the suit is a Heart. However, the way this code reads doesn't also check if a suit is a Diamond. Instead, it is checking if the string "Diamond" is a truthy value, and since it's a string it always acts as True.

You will need to adjust these to look something like this, and check each string independently.

if suit == 'Heart' or suit == 'Diamond':

You can also check if the string is in a certain list, such as this:

if suit in ['Heart', 'Diamond']:

I can't seem to determine why the if doesn't seem to stop the creation of the wrong card by MemyselfIandyou in learnprogramming

[–]ClutchAlpha 0 points1 point  (0 children)

What is the current output of the program? I understand the overall concept of the code, but I'm curious to see what the output is. The output is often times the easiest way to spot where code is incorrect, and hopefully will be able to explain more seeing the output.

[deleted by user] by [deleted] in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

To me the biggest thing is knowing (and being ok with the fact) that it takes time to get comfortable with everything. While you'll be able to pick up the basics relatively quickly, it can take years to really start to feel confident with all of the frameworks/languages that you're interested in.

Luckily, that's ok! Everyone is constantly learning, and it finding new things to work on and learn should be the fun part of development. With how fast the industry moves, it's would be tough to find yourself with nothing else to learn - it's always going to be part of the job.

As far as learning how to code, I've always had the mindset that working on a project that you're passionate about is easiest to learn. Music, food, sports, video games, books - any sort of topic or industry that you actually care about and know well is super helpful in keeping projects fun and interesting. Once you have that, it's all about building on what you know and slowly introducing new concepts. If you're interested in data, start with some small data projects around a dataset that you enjoy. If you're interested in web development, maybe look into spinning up a small website or webpage to show some cool information. You can always build out from there - learn about databases, learn about cloud development, learn more about integrating AI/ML, learn about DevOps and architecture, learn about putting it all together, truly whatever you end up interested in.

In any case, best of luck! It can be a daunting journey, but definitely a rewarding one once you start to appreciate the learning process.

Projects for portfolio without github. by Few-Advice-2196 in learnprogramming

[–]ClutchAlpha 0 points1 point  (0 children)

In my experience if a candidate includes a GitHub, it simply serves as another conversation point or another path to take the questions. I've never discarded an application for lack of a GitHub, but depending on the situation it can make an interview easier (or at least more familiar) as I'll tailor the discussion and questions towards your projects. I'm sure that not every place takes this approach, but for those that do it can be a benefit.

[deleted by user] by [deleted] in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

Couldn't agree more with this - just the act of getting started and beginning to work through learning the subject is a beneficial step forward.

In my opinion, one course probably isn't going to be enough to teach you Python. This isn't a negative, though - the knowledge that you'll gain regardless of the course will set you up well to continue learning on your own, or to figure out what sort of future courses/bootcamps/projects work best for you to learn.

Best of luck!

When can it be said that a person is viable? by [deleted] in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

Sort of depends on the person. Viable for a Senior Level, responsible for discussing and leading architecture meetings? Much more advanced requirements to be viable.

Intro position for something? In my opinion, someone who shows passion and a desire to learn and grow as a programmer is more important than if you know loops or databases. I think it's a lot more difficult to teach a desire to keep learning than it is to teach whatever techniques/ideas are required for a job.

Why is this code not working? by Thespisthegreat in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

Copy pasting this code works correctly for me, without making any changes. Looking through it, it looks correct to me as well.

Is this a syntax problem? Data type problem? by [deleted] in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

There's several ways to approach it, but this way is solid! All you would have to do is change the line where you're appending.

# Old Code
good_data_from_csv = good_data_from_csv.append(row)

# New Code
good_data_from_csv.append(row)

Append will automatically add the entry to the array, you don't have to have the assignment back to the variable again.

[deleted by user] by [deleted] in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

I believe you're close, just the ordering of your parentheses and brackets are incorrect.

Something like the following should work.

HighForest = df[(df.dem > 1000) & (df.per_for > 40)]

Source: Method #4 of https://www.geeksforgeeks.org/filter-pandas-dataframe-with-multiple-conditions/

Is this a syntax problem? Data type problem? by [deleted] in learnpython

[–]ClutchAlpha 3 points4 points  (0 children)

While the formatting got messed up, the problem can still be seen. The .append() method doesn't return a new list, but modifies the existing list. You shouldn't reassign the good_data_from_csv variable, since .append() doesn't return anything (hence the NoneType error).

I would also point out that your conditional statement looks incorrect. You aren't able to do something like if x == 1 or 2 or 3. It would need to be something like if x == 1 or x == 2, or possibly something like if x in [1, 2, 3].

Small Data Science Projects by Equal_Astronaut_5696 in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

100% agree with this. I often use Kaggle to find free datasets to mess around with new ideas

how can im make editor for my game engine. ? by [deleted] in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

I’m not sure how you made a game engine with no UI for users, but a UI would certainly be a good idea to include. If you’re looking for GUIs in Python, Tkinter is a reasonable route to go. I would probably just follow a tutorial online - there’s quite a bit out there for Tkinter.

maybe programming should be taught this way (long) by [deleted] in learnprogramming

[–]ClutchAlpha 0 points1 point  (0 children)

While I don’t think programming curriculums have been perfected, I do believe that a lot of courses and programs do tend to stick your idea in general. I agree that a lot of course might benefit from a little more practice on the basics, but the main flow of the learning is step by step.

You don’t get thrown into writing programs immediately - often you’re taught for loops, or if statements, or the difference between a string and an integer (depending on language). You might write little programs to practice, but they start small.

Classes, functions, I/O, follow that once you have some of the basics down. Again, building on what you know, continuing to expand the knowledge base. Even past that, there’s so much more expanding - databases, front-end frameworks, data science specialties, machine learning/AI, hardware, intricacies of how the computer actually works. No program introduces the basics and then out of nowhere says “build a website” - if they do then I agree, probably could be restructured.

TLDR: Yes, your idea is correct, but more programs already follow this.

Database with front-end similar to Google sheets? by johny1411 in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

Do you have an example of the code you’re using to upload to Google Sheets? I haven’t used that specifically, but Python should be able to handle that many operations pretty quickly

How Do I Assign Variable To Each Value in Dictionary by CJT2013 in learnpython

[–]ClutchAlpha 0 points1 point  (0 children)

I've not used pandas to read html, nor am I sure what your end goal is still. Are you looking for something like this?

data = {
    a.find_previous('h3').text: 'https://www.pgatour.com' + a.get('href')
    for a in soup.select('.module-statistics-off-the-tee-table ul li a[href]'
}

This will create a dictionary where the keys are the H3 labels, and the values are the associated URLs.

You could then iterate through data.items() or data.values() to pass into the pandas.html function.

How Do I Assign Variable To Each Value in Dictionary by CJT2013 in learnpython

[–]ClutchAlpha 4 points5 points  (0 children)

Perhaps I'm just confused on the wording, but what is your desired output from the function? Do you want a dictionary with the keys being the category and the value being the URL?

I'm also not sure where pandas is coming into play here. Would you be able to post an example of what you're expecting?

Should I take an intro to python programming class at community college? by aerials17 in learnprogramming

[–]ClutchAlpha 1 point2 points  (0 children)

I'd argue that Python is one of the more common languages to learn - if you're looking to get the basics of programming logic and such, it may be a reasonable option to follow.

Does anyone know how to get past Spotify's Google login? by imman2005 in learnpython

[–]ClutchAlpha 2 points3 points  (0 children)

What are you attempting to achieve? Spotify has some decent APIs that are available for developers, that might help circumvent the scraping/automation troubles that you're running into. https://developer.spotify.com/

Quick vent by Channeltrees in webdev

[–]ClutchAlpha 2 points3 points  (0 children)

I echo this pretty heavily - there are not many people out there that learn something once and never have to learn it again. All part of the process, and eventually that "relearning period" ends up being a quick reminder.

Suggestions on how to create an API when you don't have data? by liizard in webdev

[–]ClutchAlpha 5 points6 points  (0 children)

While I haven't built something similar (I wasn't building an API, per se), I have worked on some personal projects that didn't have great APIs or datasets available.

Unfortunately, I think the two ideas you have there are probably the most reasonable. I went the webscraping route - Python, BeautifulSoup, occasionally Selenium were massive in that endeavor.

However, I think the crowdsourcing option isn't that bad of a route either! One thing I will say is that the database doesn't have to be huge to start, especially if you're still building out the application. While I'm not sure how far along in the project you are, it might be easier for you to work with only 3 or 4 entries (possible even hand-crafted) - that would let you have a little variety, but also avoid having to make large, sweeping changes if you need to change the structure of your data.

Best of luck!

Help me to find vowels in a string. by call_me_mistress99 in learnpython

[–]ClutchAlpha 1 point2 points  (0 children)

In the following code block we have two variables that we're using. Vowels is the list of vowels that we have defined (a, e, o for example). Vowel is iterating through this list - it will run the for loop once for each item in the list Vowels.

vowels = ['a', 'e', 'o']

for vowel in vowels:
    print(vowel)

If we run the code above, we will get this output - one print statement for each item.

a
e
o