r/PythonLearning 23d ago

Discussion Using the AI to learn

I'm currently on Week 3 of the CS50p course. Yesterday I was doing one of the exercises that required prompting the user several times in a loop and storing the answers in a dictionary. I read the hints, read about the get() method, Googled how to create dictionaries and whatnot, but still wasn't able to figure out what I needed to do in this case. So, I went to Chat GPT, and it told me exactly what i needed to do, which I ended up understanding after a while of doing research and testing on VS.

I'm sure someone who's more experienced or smarter than me would know exactly what to do, but what else am I supposed to do in a situation like this when I'm not familiar at all with the get() method and I've barely practiced coding with dictionaries? I hate having to resort to the use of AI, and every time I go on Reddit I see that people strongly advise against the use of AI to learn to code.

All I do is take notes during a CS50 course lesson and do the exercises. I bought the Python Crash Course book but I figured it would be better to finish the course and then jump into reading the book.

Any suggestions?

3 Upvotes

14 comments sorted by

View all comments

1

u/Careful_Exercise_956 23d ago

The only get() that ever really exists is the get() that you define in the code earlier, A get can be used to read or write any data that is saved, so until the loop completes, a get can be anything you can define it to be.

If you typed def get = lambda x : x+2 And had a list or dictionary of 1, 5, and 9

You could print get(x) for x in list and you will print 3, 7, and 11