234 questions linked to/from Tips for golfing in Python
4k views

Diamond creator +

Challenge : Given an integer n as input. Create a diamond that is 2x the given number n. Input : Input is integer ...
1k views

A list of number modulus their indices in the list

A simple one: Take a list of positive integers as input and output the numbers modulus their 1-based index in the list. If the input integers are ...
6k views

Is string X a subsequence of string Y?

Given strings X and Y, determine whether X is a subsequence of Y. The empty string is regarded as a subsequence of every string. (E.g., '' and ...
7k views

Minecraft Mirrored

This is Calvin. Just trying to get 20 rep so this user can chat in the PPCG Minecraft Server chatroom. Write a program or function that takes in a positive integer. If the integer is even (2, 4, 6, ....
2k views

Return the integers with square digit-sums

Introduction and Credit We all know and love our awesome rules to test whether a number is divisble by 11 or 3, which is just some clever sum over the digits of the number. Now this challenge takes ...
3k views

Print a booklet

Reading a book is easy, but printing a book can be a bit tricky. When printing a booklet, the printer needs to have the pages arranged in a certain manner in order to be read from left to right. The ...
2k views

Twisting Words!

Twisting Words! Given a string and a positive integer. You must twist the string, back and forth. Example Input / Output Input ...
3k views

Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, ...
3k views

Help me Open the Box

I have an ASCII-art box and I need a program to open it. Examples Input: ------- | | |_____| Output: ...
4k views

How many lights are on?

You are little speck on a Cartesian plane. Pondering your existence, you decide to roam around your plane and touch things. You notice that every coordinate pair you visit has a light switch. To ...
3k views

16-bit binary grid

Given any unsigned 16 bit integer, convert its decimal form (i.e., base-10) number into a 4x4 ASCII grid of its bits, with the most-significant bit (MSB) at the top left, least-significant bit (LSB) ...
5k views

Draw an ASCII Rectangle

Given two integers as input in an array, draw a rectangle, using the first integer as width and second as height. Or, if your language supports it, the two integers can be given as separate inputs. ...
4k views

Render “Digital Clock Style” Numbers

Write the shortest program which will take a string of numbers (of up to at least 20 length) as input, and display the output using the standard digital clock style numbers. For instance for input 81,...
How far should I sum? The harmonic series is the "infinite sum" of all the fractions of the form $\frac1n$ for $n$ positive integer. I.e. the harmonic series is \frac11 + \frac12 + \frac13 + \...