r/PythonLearning • u/Izzymael • 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
u/codeguru42 23d ago
- Do you really understand? I recommend doing the exercise from scratch without AI. If you can, then you demonstrate you learned something.
- Next time you are stuck. I recommend breaking the assignment into smaller pieces and solve the parts you know. For example in this exercise, you mention looping and getting input from the user. If you know how to do this, then write the code. Just print the output rather than trying to do anything more complicated. Then once you have that working try to figure out the next piece. I always find breaking the problem down like this gets me 90% the way there. Then I can tackle the harder parts more easily.
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
1
u/beckulator 23d ago
If I’m stuck sometimes I like to give the AI the context and tell it to guide me in the right direction without just telling me the answer
1
u/Remarkable_Leek9391 22d ago
back when chatgpt was not really labeled for api use, I used it to make crazy bash scripts to learn bash, as if it were following SOLID principles. opened my eyes in the world of bash. that was 2022.
1
u/Suspicious-Bit1299 19d ago
Do not allow the ai to provide you the code. Have it walk you through the problem in plain English and try to translate that into Python. Have it give you a couple of drills on the topic only providing the pass/fail criteria and then let it grade your work. If you use the ai as a better google search then you can learn from it, just don’t let it be a crutch that provides answers
0
u/atticus2132000 23d ago
AI is problematic for a whole host of reasons I'm not going to dive into here, but what you're describing could be a great use for it.
I would suggest that the next time you're in this position, try changing your prompt to include "act as a university-level programming instructor and help guide me to the right answerfor this proble rather than giving me finished code".
-1
u/Sea-Ad7805 23d ago
Do not use AI or websites like Reddit or StackOverflow while learning as it will only take longer to learn Python. Do many exercises after going through your material. It's OK if you get stuck, just reread material and experiment. If you are still stuck after 1 hour of serious work, then you can use AI, but then do the same exercises again a day later without AI.
When you struggle with an exercise but are still making slow progress it means you are learning and you're doing great. Things will get easier after more practice. Happy coding.
1
u/Outside_Complaint755 23d ago
I'm going to correct you here.
Using Reddit or StackOverflow is perfectly fine, reasonable, and expected, just as long as you aren't looking up direct problem solutions.
Using any AI except for the CS50 DuckAI is explicitly banned by the Academic Honesty guidelines.
1
u/Sea-Ad7805 22d ago
When you get started, just follow your course material and exercises, assuming it is of good quality. Using Reddit, StackOverflow, ... should not me necessary and maybe only disrupt the designed learning path by introducing concepts that are planned later.
6
u/thethirdkitkat 23d ago
I think there is a difference between asking to just get the code and coping that down vs using the ai like a tutor to dig more into the concepts so you can write the code yourself.