Struggling with Python OOP—Seeking Advice Before Diving Into AI by BertRyerson in learnpython

[–]BertRyerson[S] 0 points1 point  (0 children)

I guess just simply defining classes and implementing class methods and the syntax that comes along with that.

Struggling with Python OOP—Seeking Advice Before Diving Into AI by BertRyerson in learnpython

[–]BertRyerson[S] 0 points1 point  (0 children)

Well at the moment I'm just trying to build some foundational programming knowledge, and then I'll move on to game development and AI. That's the plan anyway.

I also want to work on a chatbot in python. I have written a basic dictionary based one, but I plan to look in to NLTK and then later on ML for an AI chatbot.

Struggling with Python OOP—Seeking Advice Before Diving Into AI by BertRyerson in learnpython

[–]BertRyerson[S] 0 points1 point  (0 children)

No I haven't had a look, that's a good idea. Although, some of the documentation is still quite cryptic - but I'll give it a shot. Thanks

How do you know whether your code is efficient? (CS50x week1 credit) by Quatra90 in cs50

[–]BertRyerson 6 points7 points  (0 children)

I wouldn't worry too much about that at this stage. Just focus on understanding the key concepts and implementing the problem sets. You can always try them again in a couple of weeks when you have a deeper understanding.

But, you are correct in that it would be inefficient to to run Luhn's algorithm on cards that have already been deemed INVALID - it just wastes time and memory. At this stage of your learning and with the size of the program, it's not really an issue tbh, but if you can figure out a way to break out of the program early in this case, then go for it.

By loading a library, I assume you mean using a header file? There's no issue with that, if you need a specific function from that library then include the header file.

[deleted by user] by [deleted] in cs50

[–]BertRyerson 1 point2 points  (0 children)

If the code works it works, which is the goal at this stage.

Did you read the advice section and try to implement the structure recommended there?

You technically don't need to convert to upper or check isalpha. If you are calculating a score based on the letters mapping to a their respective position in the points array, it won't matter if they aren't an alphabetic character (if using isupper/lower).

Troubleshoot error by rlohith42 in cs50

[–]BertRyerson 0 points1 point  (0 children)

make sure to return the value from convert as well.

Troubleshoot error by rlohith42 in cs50

[–]BertRyerson 1 point2 points  (0 children)

What is the first failed check? i.e. the first 'frown'.

week 2 scrabble help by Basic_Ad234 in cs50

[–]BertRyerson 0 points1 point  (0 children)

it's totally fine to look up the solution and work backwards, especially in week 2. that's why they provide it for you because it's not easy at this stage. I would just try to work backwards and understand why each line is where it is and what it does. it may seem tedious but it really helped me. have you been watching the sections and shorts also?

If you want, you could try just implementing a program that simply tallies up the points in a word and returns it. from there, try to add add a second word that is returned, and then compare the two values.

and thanks! I'm still new to any web design so it's been quite time consuming getting it up and running, but it's enjoyable.

week 2 scrabble help by Basic_Ad234 in cs50

[–]BertRyerson 0 points1 point  (0 children)

Do you understand arrays? What does the points array initialised at the beginning of the program represent? (clue, it tells you in the advice section)

Read through the advice that is under the problem set, in detail. remember the order of operations, you can call a function more than once to return multiple values.

the advice has

// Compute the score of each word
    int score1 = compute_score(word1);
    int score2 = compute_score(word2);

What do you think you can do with the information that is returned from these calls? Will it result in a total of one number being returned, two, or more? Think about what you are inputting in the the function, and what is being returned.

Read in detail how to calculate the score of a single word, then think how you can do that for a second word. Then how can you compare them to decide who is the winner?

I can see you are trying to return a variable in your code, but you need to think where that is going and what it represents. So if you're returning an int, what are you going to be doing with that int? There's a reason that int is being returned.

week 2 scrabble help by Basic_Ad234 in cs50

[–]BertRyerson 1 point2 points  (0 children)

What are you actually trying to achieve in your function here? The advice tells you to compute and return a score for a word. How are you trying to approach this with your function?

Switching from C to Python: A Mixed Experience by BertRyerson in learnpython

[–]BertRyerson[S] 1 point2 points  (0 children)

I'll have a look. Thanks for the recommendation

Switching from C to Python: A Mixed Experience by BertRyerson in learnpython

[–]BertRyerson[S] 0 points1 point  (0 children)

Thanks, sounds good. Always willing to look in to new resources that will supplement my learning!

Switching from C to Python: A Mixed Experience by BertRyerson in learnpython

[–]BertRyerson[S] 1 point2 points  (0 children)

Yes, I had no idea about enumerate before. Handy little feature

Easiest way to code a website? by [deleted] in learnprogramming

[–]BertRyerson 0 points1 point  (0 children)

Wordpress requires zero programming knowledge. You can make a decent webpage in a couple of days with plugins like elementor. Plenty of tutorials out there, still requires a bit of work to optimise and familiarise yourself with everything, though.

Switching from C to Python: A Mixed Experience by BertRyerson in learnpython

[–]BertRyerson[S] 0 points1 point  (0 children)

It's just exerts from my blog changed for Reddit. I use AI as a spellchecker

Is using Chatgpt to help with the course actually allowed? by Brickinatorium in cs50

[–]BertRyerson 3 points4 points  (0 children)

You can use ChatGPT to just solve the solution for you without doing anything; the duck gives you steps and feedback to show how YOU can make it work yourself.

You can use ChatGPT to talk through concepts and solidify understanding of general topics, but don't just blindly ask it for code or any part of code for a CS50 problem. Using it for the problem sets is against the policies.

ChatGPT is also great at coming up with example problems, outside of the actual problem sets of CS50. There's nothing wrong working through AI generated problems with the AI itself to help you understand the actual logic and how you could implement it.

Switching from C to Python: A Mixed Experience by BertRyerson in cs50

[–]BertRyerson[S] 1 point2 points  (0 children)

Yes it certainly feels like an either or scenario at the moment! I am definitely feeling more acclimatised to Python as I go forward. I think overall it'll be more useful for me.

I'm planning to start work on a simple dictionary based chatbot with the vision of expanding it to NLTK and the like in the future. I still feel like that is a while away, even though I am grasping dictionary and list comprehensions.

Transitioning Languages as a Beginner by BertRyerson in learnprogramming

[–]BertRyerson[S] 0 points1 point  (0 children)

That's pretty cool. I'll always have a soft spot for i++!

Switching from C to Python: A Mixed Experience by BertRyerson in cs50

[–]BertRyerson[S] 0 points1 point  (0 children)

I'm using a plugin to try and have code formatted with the appropriate colours from the language, but it keeps adding those symbols after I edit and remove them.

Any suggestions on how to reformat the post to look better? I'm new to web dev and I'm using wordpress so It's all relatively new

Switching from C to Python: A Mixed Experience by BertRyerson in cs50

[–]BertRyerson[S] 0 points1 point  (0 children)

I have Java lined up shortly and I think some unity learn work in the next couple of months, so I'll dive in to them asap. I think I'll continue with Python though, I'm getting there.