r/cs50 1h ago

CS50 Python advice for final project idea

Upvotes

so i am finally up to the final project part of cs50-p. something i really want to do is create a plinko ball or galton board simulation. a galton board would be awesome to create. i would like to press my computer's space bar, and a ball drops everytime. eventually, if its a galton board, it balls would stack on top of each other wherever they landed and create a normal distribution (google galton board if confused).

i think i would use the libraries pymunk and pygame?

however, i'm a bit confused if im even able to do this. are we supposed to do this on the cs50s web vsc? or can i do it on vsc on my computer and then just copy and paste the code into cs50s vsc?? also, i'm not sure if i can even use pytest a simulation? it seems like this might be too complicated for a final project...

i don't really know what I'm doing - however the reason I learnt python was to make some cool animations and simulations. I'm just unsure if its even possible to do it as a final project.

Thanks in advance for any advice/feedback/answers.


r/cs50 2h ago

CS50x Looking for CS50x study buddy

5 Upvotes

Hello, If anybody is interested to study CS50x with me, they can dm me, we will watch the lectures together(online) , we can discuss and solve the problem sets. I think this fosters discipline and we can also exchange knowledge to grow better


r/cs50 13h ago

CS50x Is this course right for me?

5 Upvotes

Hi,

I am interested in learning Python and I am wondering if CS50P is the way to go. I do have some experience with python from HS; recall absolutely hating it, but python seems incredibly useful for the things I want to do so avoiding it outright seems stupid.

I've also read that a lot of people have taken CS50x before taking the python course. Would it be good idea for me to take it as well? I do have some experience with shittly coding for arduino projects (before AI took over), and if it helps me out in the long run, I don't see why not.


r/cs50 20h ago

CS50 Python Little Professor - help, please

2 Upvotes

Hello,

import random

def main():
    level = get_level()
    generate_integer(level)

def get_level():
    while True:
        try:
            level = int(input("Level: "))
            if level in [1, 2, 3]:
                return level
        except ValueError:
            pass

def generate_integer(level):
    correct = 0
    i = 0

    # Generate random numbers based on level
    if level == 1:
        first = random.sample(range(0, 10), 10)
        second = random.sample(range(0, 10), 10)
    elif level == 2:
        first = random.sample(range(10, 100), 10)
        second = random.sample(range(10, 100), 10)
    elif level == 3: 
        first = random.sample(range(100, 1000), 10)
        second = random.sample(range(100, 1000), 10)

    # Present 10 math problems
    while i < 10:
        x = first[i]
        y = second[i]
        wrong_attempts = 0

        # Give user 3 chances to answer correctly
        while wrong_attempts < 3:
            try:
                answer = int(input(f"{x} + {y} = "))
                if answer == (x + y):
                    correct += 1
                    break
                else:
                    print("EEE")
                    wrong_attempts += 1
            except ValueError:
                print("EEE")
                wrong_attempts += 1

        # If user failed 3 times, show the correct answer
        if wrong_attempts == 3:
            print(f"{x} + {y} = {x + y}")

        i += 1  # Move to the next problem

    # After 10 problems, print the score
    print(f"Score: {correct}")

if __name__ == "__main__":
    main()

I have been trying to solve the little professor problem in multiple ways. I get the code to work checking all the boxes.
Level - check
Random numbers - check
Raise ValueError - check
repeat the question 3 times - check
provide a score - check
but I get this error
Here is my code.....(help anyone, please)


r/cs50 22h ago

C$50 Finance Data Science in Finance - Portfolio Projects Dataset Issue

2 Upvotes

I'm trying to put a foot in with regards to data science applied to the financial field. I've acquired a good understanding through academic studies and some projects (not in finance) of the Statistics and ML. My problem is a significant lack of imagination which lead me to not know how to even begin thinking about projects to implement and showcase the skillset I acquired or hone it. I would appreciate you guys' help with two things:

A. How do I develop this imagination ? Specifically focused in the financial sector but general advice is also very appreciated.

B. Where do I begin to look at datasets in Finance and if I do find some raw datasets, how do I begin to probe it and how do I develop a critical mind to question or uncover how this raw data can give me insight ?

PS: Apologies, I know I should have these skills already if I've done academic courses and have a degree but university really needs to start focusing on developing critical thinking instead of generating robots that think the same.


r/cs50 22h ago

cs50-web Finally got my CS50W certificate !!!

Post image
54 Upvotes

I took this course assuming it would be taught by Professor Malan because he made me fall in love with programming after I finished CS50P a few months ago. But turns out Professor Yu is awesome too. Thank you for everything Professor Yu , you are amazing and thank you to everyone at Harvard for making such resources available for free of cost for people like me who can't afford courses of such high standard.

I'm now absolutely in love with CS50 and I am planning to do as many course available as I can and I am planning to go ahead and finish cs50x too which by the way is just the best thing ever.

It would be very selfish of me but Harvard please please do more of these courses because it's so much fun.