Ad
  • Default User Avatar

    This is not a difficult problem by itself, but you can make it more interesting for yourself by giving yourself an extra challenge (like code golf) or solving it in a unique way. Of course it is easy to take a piece of code and add some lines that never do anything to the end. The only thing that can prevent you from doing that is ennui and your own desire for a challenge. so I suggest you try actually improving on the previous solution. There's a very nice way to both shorten this code and make it more efficient. Try reading up on the third argument of Python range to see what I'm getting at.