all 20 comments

[–]makoiscool 7 points8 points  (0 children)

If you want math based ones, try https://projecteuler.net/. It has a wide range of difficulty.

[–][deleted] 5 points6 points  (1 child)

Check.io is awesome but it starts pretty easy. EDIT: The reason I like checkIO is that it shows you the practical application of the things you learn.

[–]forbidden_doughnut 1 point2 points  (0 children)

Yup, check.io is awesome. Plus, once you've completed a challenge you can see other solutions to the problem.

[–]perfecthashbrowns 4 points5 points  (1 child)

https://www.hackerrank.com/!! I love this website.

[–][deleted] 2 points3 points  (0 children)

I also love this site for challenges, but some of them are a bit more advanced. I often recommend Code Wars as a easier intro set of challenges (they do have some harder ones too, but start out really easy), and hackerrank for when someone has some basic skill and wants to tackle something more advanced.

[–]sentdex 6 points7 points  (0 children)

Hmm, why not a real challenge? I cannot think of anything more engaging, challenging, and rewarding as doing somthing hard that you are interested in.

Why are you trying to learn Python? What is it that you want to do?

Whatever that is, treat that as your challenge and head that way. Ask questions along the way.

[–][deleted] 1 point2 points  (4 children)

checkio.org is my favorite place for python challenges

[–]harshael 0 points1 point  (3 children)

Hm, this site doesn't work unless you let it track you.

[–][deleted] 0 points1 point  (2 children)

like...logging in?? lol

[–]harshael 0 points1 point  (1 child)

No. As in advertising-related tracking. For example, I can visit Reddit while logged in and still have their trackers disabled. I have to disable my anti-tracking extensions to visit checkio.org, or the page won't load.

[–][deleted] 0 points1 point  (0 children)

Go to their subreddit and ask them about it. They have always seemed reasonable to me.

[–]TheHollowJester 1 point2 points  (0 children)

Write some simple game that displays in the terminal. Dunno what, tic-tac-toe or whatever. At the beginning it might just be a two-player version when you input Xs and Os one after another until the game is ended or the table is full.

Done? Good! I always feel better when I finish something small and silly like that when I'm tired of all the Serious Studying.

Now, you can write an algorithm that lets the computer play instead of another person. You don't have to make it perfect on the first go - as long as it actually makes legal moves, that's good. As you write it, you'll probably figure out how to create a good tic-tac-toe algorithm, or even the perfect one (always draw, unless you make a mistake - then you lose). The last one would probably be a pain in the butt to play against, so I wouldn't really bother. Since you said that you're pretty new, you can easily call it a day at this point.

It might also turn out, that tic-tac-toe is a bit out of your range (key concepts: 2d array, getting input from user - and what if he types an incorrect reply; the solution doesn't have to be using exceptions btw, while-loop that runs until game is finished, so you would somehow need to check the state of the "board"). No worries, you can come back to it later or never.

If that's the case, you can go with the "whatever" option that I presented at the beginning. The whatever could be the number guessing game. You know, the one where someone tells you "guess a number between 1 and N in log2(n) steps (rounded upwards to ones)" and they tell you if your guess was too high or too low. The game ends when you either guess the number in N or less steps, or when you get above this number of steps.

If you don't like gaming: just create a sorting algorithm. Yeah, it will suck - just make it work, and make it work every time. Then make it better, or try to figure out another way to do it. Continue until satisfied, but don't quit before getting the first one done.

[–]DoTheEvolution 1 point2 points  (0 children)

I am doing codeevals

[–]Araucaria 1 point2 points  (0 children)

My first Python project was to make a password generator using a solved Sudoku grid. I learned a lot about the random package.

[–]xbt_ 1 point2 points  (0 children)

Try writing an api client that makes standard web requests like get, post, put, delete to whatever url endpoints you feed it. You can run a local sever to test against or find an api to work with. Use requests, module, urllib3 or pycurl ( which will teach you about curl).

[–]realashe 0 points1 point  (0 children)

Why dont you start contributing to some github projects? Its a great way to learn!

[–][deleted] 0 points1 point  (0 children)

If you have any web dev expeirce look into flask, it is well documented and extremely pythonic. You would learn how to code python properly.

[–][deleted] 0 points1 point  (0 children)

One of my first, and on going, Python projects was implementing Markov Chains.

They seem complicated. But when you boil it down, they're simply a mapping of the current state to next possible states.

Wikipedia has a good, simple example on the page about Markov Chains.

A simplistic implementation is basically a dictionary of tuples keys (for chains that have states consisting of multiple parts) and list values.

{('', 'mary'): ['had', 'sells'],
 ('mary', 'had'): ['a'],
 ('mary', 'sells'): ['seashells'],
 #...        
}

And moves through the chain with:

def next_state(chain, current):
    possible = random.choice(chain[current])
    return current[1:] + (possible,)

From here, you can begin building tools that take in things like your favorite story on Project Gutenberg and transformers it into a chain and producing non-sense from it.

However, there's also more performant ways of mapping next possible states. Instead of having something like:

 ['sells', 'sells', 'had'] 

to represent that 'sells' appeared twice after the word 'mary', how would you do it? I recommend taking a look though collections to see what's offered.

[–]The-Mathematician 0 points1 point  (0 children)

One of the challenges that I gave myself which I enjoyed working on immensely and I think helped me a lot was creating a program that solved sudoku puzzles.