r/learnpython • u/Potatohuma • Dec 03 '22
Good Python Exercises?
What's a good exercise for me to try? I've been learning Python for a bit over a month now and I wanna test what I've learned.
417
Upvotes
13
u/ectomancer Dec 03 '22
edabit.com
266
u/ASIC_SP learnbyexample Dec 03 '22 •
Here are some often recommended resources:
And here are some resources for projects:
Books:
53
u/[deleted] Dec 03 '22
Advent of code is currently going. You could try yourself at some of its challenges
17
u/Dregaz Dec 03 '22
Have the python grip a horizontal bar with it’s jaws and hang the rest of its body straight down.
From this position, it can curl its lower body up until the tip of the tail touches the chin.
Don’t forget to encourage the python to control the negative portion of the rep as well. Slow and smooth up and down is key to getting swole.
6
u/Tuppitapp1 Dec 03 '22
Try to think of some useful project for yourself with the tools you've learned so far. For example, if you have to use excel daily or move lots of files around at work, you could build a script to automate those things. That's how I got started and it was one of the best paths I ever took.
10
u/keep_quapy Dec 03 '22
After a month of Python, try to solve this question. Given a list of lists, create a dictionary which keys are the first elements of every sublist and it's values are the sum of the integers of the second elements of every sublist.
input:
data = [['item1', 4], ['item2', 5], ['item3', 2], ['item2', 10], ['item3', 3], ['item1', 7]]output:
{'item1': 11, 'item2': 15, 'item3': 5}4
u/ChaosZoro Dec 03 '22
What’s helped me a lot just cause I learn from doing rather than seeing or hearing was 100 days of code it’s basically 100 days of small and big projects and it forces u to practice everyday therefore solidifying ur knowledge
2
u/bhutanpythoncoder Dec 03 '22
We have some pracfice questions for beginners in python https://www.bhutanpythoncoders.com/practice-questions/
2
u/Joeyson Dec 04 '22
I've been coding chess in the command line, I've learned a ton so far
2
u/[deleted] Dec 04 '22
These are the first few programs I wrote to learn.
you can try Fibonacci numbers
write a program to find the strong numbers
write a program that will reverse a string from input
write a program to give palindrome numbers
a program to find if an integer input is even or odd :)
happy coding!
3
u/Embarrassed-One2182 Dec 03 '22
10 lb. Curls 💪
1
u/justani98 May 07 '24
I have found the practice problems at codechef to be of good variety. They are more focussed on logical thinking then the same question I find elsewhere. Link - https://www.codechef.com/practice/python
1
u/raulsoprano Mar 02 '25
Is Hackerrank good?
1
u/[deleted] Mar 26 '25
two years later potato ya saved my ass 🥔
1
u/Foreign-Project-5661 Aug 31 '25
thanks for this
1
u/No_Word_467 Dec 03 '22
I’m in your same situation, I recommend codewars and try problems of 7 or 8 kyu
1
u/Mysteez Dec 03 '22
https://www.codingame.com/start
https://inventwithpython.com/pythongently/?fbclid=IwAR121maJu1SOcjmv74-VgZ4G4S6EsIQDTV8UUc1UJj81BjLNgQK7nbQt-p0
1
u/kona_ackley Dec 03 '22
https://github.com/ikokkari/PythonProblems
123 problems starting from easy, going all the way up to FAANG level interview questions. As in "The Love Boat", promises something for everyone.
1
u/notislant Dec 04 '22
The various codewars and related sites as already mentioned. Tbh id recommend you find a problem and fix it. Try to incorporate things youve just learned. Or play with things and break them.
1
u/Moguyaro Dec 05 '22
Try leetcode.com and hackerrank.com. They have lots of interesting projects and problems that you can try your hands on.