[Question]
  [
Your task is to write a program that outputs the *exact* string `Programming Puzzles` (trailing newline optional), but when all spaces, tabs, and newlines are removed it outputs `Code Golf` (trailing newline optional.) 
Your byte count is the count of the first program, with spaces still there.
# Notes
* The spaces in `Code Golf` *and* `Programming Puzzles` will be removed as part of the removal, so plan accordingly.
* In encodings where 0x09, 0x0A and 0x20 aren't tabs, newlines or spaces respectively, those chars will be removed.
* If your code is
```
42  $@ rw$
@42
```
then that must output `Programming Puzzles`. Also, in the same language,
```
42$@rw$@42
```
must output `Code Golf`.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins! Good luck!
  
[Answer]
# [Python 2](https://docs.python.org/2/), 50 bytes
```
print["Code\40Golf","Programming Puzzles"][" ">""]
```
[Try it online!](https://tio.run/nexus/python2#@19QlJlXEq3knJ@SGmNi4J6fk6akoxRQlJ9elJibm5mXrhBQWlWVk1qsFButpKBkp6QU@/8/AA "Python 2 – TIO Nexus")
With all spaces removed:
```
print["Code\40Golf","ProgrammingPuzzles"]["">""]
```
[Try that online!](https://tio.run/nexus/python2#@19QlJlXEq3knJ@SGmNi4J6fk6akoxRQlJ9elJibm5mXHlBaVZWTWqwUG62kZKekFPv/PwA)
Thanks to Stephen S for 3 bytes, and Erik the Outgolfer for 1
[Answer]
# [Python 2](https://docs.python.org/2/), ~~48~~ 47 bytes
-1 byte thanks to Erik the Outgolfer
```
print' 'and'Programming Puzzles'or'Code\40Golf'
```
[Try it online!](https://tio.run/nexus/python2#@19QlJlXoq6gnpiXoh5QlJ9elJibm5mXrhBQWlWVk1qsnl@k7pyfkhpjYuCen5Om/v8/AA "Python 2 – TIO Nexus")
```
print''and'ProgrammingPuzzles'or'Code\40Golf'
```
[Try it online!](https://tio.run/nexus/python2#@19QlJlXoq6emJeiHlCUn16UmJubmZceUFpVlZNarJ5fpO6cn5IaY2Lgnp@Tpv7/PwA "Python 2 – TIO Nexus")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 bytes
```
“Ñ1ɦ+£)G“½ċṭ6 Ỵ»Ṃ
```
[Try it online!](https://tio.run/nexus/jelly#@/@oYc7hiYYnl2kfWqzpDuQc2nuk@@HOtWYKD3dvObT74c6m//8B "Jelly – TIO Nexus")
### How it works
As in the other Jelly answer, `Ñ1ɦ+£)G` and `½ċṭ6Ỵ` encode the strings **Programming Puzzles** and **Code Golf**. `“` begins a string literal and separates one string form another, while `»` selects the kind of literal (dictionary-based compression), so this yields
```
["Programming Puzzles", "Code Golf"]
```
`Ṃ` then takes the minimum, yielding **Code Golf**.
However, by adding a space between `½ċṭ6` and `Ỵ`, we get a completely different second string, and the literal evaluates to
```
["Programming Puzzles", "caird coinheringaahing"]
```
Since **caird coinheringaahing** is lexicographically larger than **Programming Puzzles**, `Ṃ` selects the first string instead.
[Answer]
# C, ~~64~~ ~~62~~ ~~53~~ 52 bytes
```
f(){puts(*" "?"Programming Puzzles":"Code\40Golf");}
```
[Try it Online!](https://tio.run/nexus/c-gcc#@5@moVldUFpSrKGlpKBkrxRQlJ9elJibm5mXrhBQWlWVk1qsZKXknJ@SGmNi4J6fk6akaV37PzOvRCE3MTMPqBeoHygAAA)
Uses the fact that C strings end with a null character
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 15 [bytes](https://github.com/Adriandmen/05AB1E/blob/master/docs/code-page.md)
```
”ƒËŠˆ”" "v”–±ÇÀ
```
[Try it online!](https://tio.run/nexus/05ab1e#@/@oYe6xSYe7jy443QZkKikolQGpRw2TD2083H644f9/AA "05AB1E – TIO Nexus")
**Explanation**
```
”ƒËŠˆ”           # push "Code Golf"
      " "v       # for each character in the string " " do
          ”–±ÇÀ  # push "Programming Puzzles"
                 # implicitly output top of stack
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 18 bytes
```
“½ċṭ6Ỵ»ḷ
“Ñ1ɦ+£)G»
```
[Try it online!](https://tio.run/nexus/jelly#ASYA2f//4oCcwr3Ei@G5rTbhu7TCu@G4twrigJzDkTHJpivCoylHwrv//w "Jelly – TIO Nexus")
## Explanation
In the program as written, the first line is a helper function that's never run. The second line (the last in the program) is the main program, and is the compressed representation of the string `"Programming Puzzles"` (which is then printed implicitly).
If you remove the newline, the whole thing becomes one large program. `“½ċṭ6Ỵ»` is the compressed representation of the string `"Code Golf"`. `ḷ` evaluates but ignores its right hand argument, leaving the same value as before it ran; it can be used to evaluate functions for their side effects (something I've done before now), but it can also be used, as here, to effectively comment out code.
Interestingly, the actual logic here is shorter than the 05AB1E entry, but the code as a whole comes out longer because the string compressor is less good at compressing these particular strings.
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 38 bytes
```
" ""Programming Puzzles""Dpef!Hpmg":(?
```
[Try it online!](https://tio.run/nexus/cjam#@6@koKQUUJSfXpSYm5uZl64QUFpVlZNarKTkUpCapuhRkJuuZKVh//8/AA "CJam – TIO Nexus") or [with spaces removed](https://tio.run/nexus/cjam#@6@kpBRQlJ9elJibm5mXrhBQWlWVk1qspORSkJqm6FGQm65kpWH//z8A)
**Explanation**
```
" "                    e# Push this string.
"Programming Puzzles"  e# Push "Programming Puzzles".
"Dpef!Hpmg":(          e# Push "Dpef!Hpmg" and decrement each char, giving "Code Golf".
?                      e# If the first string is true (non-empty) return the second string,
                       e#   else return the third.
```
Whether spaces are in the program or not determines if the first string is truthy or falsy.
[Answer]
# Javascript, ~~46~~ ~~43~~ 42 Bytes
```
x=>" "?"Programming Puzzles":"Code\40Golf"
```
```
console.log((x=>" "?"Programming Puzzles":"Code\40Golf")())
console.log((x=>""?"ProgrammingPuzzles":"Code\40Golf")())
```
[Answer]
## Haskell, 48 bytes
```
a _="Programming Puzzles";a4="Code\32Golf";f=a 4
a_="ProgrammingPuzzles";a4="Code\32Golf";f=a4
```
Defines function `f` which returns the corresponding string.
For reference, the old version is: 
### Haskell, 49/47 bytes
```
f""="Code\32Golf";f(_)="Programming Puzzles";f" "
```
with spaces removed
```
f""="Code\32Golf";f(_)="ProgrammingPuzzles";f""
```
Two simple pattern matches. `(_)` matches all patterns. You can improve the without-spaces version by one byte by defining the second pattern as `f" "=`/`f""=`, but this gives a "Pattern match is redundant" warning. 
Alternative solution with the same byte count:
```
last$"Code\32Golf":["Programming Puzzles"|" ">""]
last$"Code\32Golf":["ProgrammingPuzzles"|"">""]
```
[Answer]
## Wolfram language, 62 bytes
```
"Programming Puzzles"[ToExpression@"\"Code\\.20Golf\""][[0 1]]
```
The space in `[[0 1]]` is implicit multiplication, so this is equivalent to `[[0]]`. Without a space, `01` is just `1`. The 0th and 1st parts of this expression are the strings we want.
Another solution of questionable validity (44 bytes, 2 saved by Kelly Lowder):
```
"Programming Puzzles"["Code\.20Golf"][[0 1]]
```
The `\.20` gets replaced by a space immediately when typed into a Mathematica environment, so it's not clear if it gets removed along with the other spaces…
[Answer]
## Excel - 56 Bytes
```
=IF(""=" ","Code"&CHAR(32)&"Golf","Programming Puzzles")
```
Very similar to most of the other answers... nothing fancy here.
[Answer]
# [Ohm](https://github.com/MiningPotatoes/Ohm), ~~33~~ 32 bytes
Uses CP437 encoding.
```
▀Bn¬i≈╣Ü╝Rb╡°╧S½uÇ▀
▀4>~H├MS░l╬δ
```
[Try it online!](https://tio.run/nexus/ohm#AT8AwP//4paAQm7CrGniiYjilaPDnOKVnVJi4pWhwrDiladTwr11w4filoAK4paAND5@SOKUnE1T4paRbOKVrM60//8 "Ohm – TIO Nexus") or [try without whitespace](https://tio.run/nexus/ohm#AT4Awf//4paAQm7CrGniiYjilaPDnOKVnVJi4pWhwrDiladTwr11w4filoDiloA0Pn5I4pScTVPilpFs4pWszrT//w)
### Explanation
**With whitespace:**
```
▀Bn¬i≈╣Ü╝Rb╡°╧S½uÇ▀    Main wire
▀Bn¬i≈╣Ü╝Rb╡°╧S½uÇ▀    Push "Programming Puzzles" (compressed string)
                       Implicitly output the top stack element
▀4>~H├MS░l╬δ           Helper wire (never called)
```
**Without whitespace:**
```
▀Bn¬i≈╣Ü╝Rb╡°╧S½uÇ▀▀4>~H├MS░l╬δ    Main wire
▀Bn¬i≈╣Ü╝Rb╡°╧S½uÇ▀                Push "Programming Puzzles" (compressed string)
                   ▀4>~H├MS░l╬δ    Push "Code Golf" (compressed string)
                                   Implicitly output top stack element
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 29 bytes
With spaces:
```
`Co¸{S}Golf`r `PžgŸmÚÁ Puzz¤s
```
[Try it online!](https://tio.run/nexus/japt#@5/gnH9oR3VwrXt@TlpCkUJCwKF56Yfm5x6edbhRIaC0qurQkuL//wE "Japt – TIO Nexus")
Without spaces:
```
`Co¸{S}Golf`r`PžgŸmÚÁPuzz¤s
```
[Try it online!](https://tio.run/nexus/japt#@5/gnH9oR3VwrXt@TlpCUULAoXnph@bnHp51uDGgtKrq0JLi//8B "Japt – TIO Nexus")
---
This takes advantage of the fact that in Japt, a space closes a method call. With spaces, the code is roughly equivalent to this JavaScript code:
```
("Code"+(S)+"Golf").r(),"Programming Puzzles"
```
This is evaluated as JavaScript, and the result is sent to STDOUT. Since the last expression is `"Programming Puzzles"`, that string is printed.
Without spaces, the code is roughly equivalent to:
```
("Code"+(S)+"Golf").r("ProgrammingPuzzles")
```
(If you haven't figured it out by now, the `S` variable is a single space.) The `.r()` method on a string, if given one argument, removes all instances of that argument from the string. Since `"Code Golf"` does not contain `"ProgrammingPuzzles"`, it returns `"Code Golf"` unchanged, which is then sent to STDOUT.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 44 bytes
```
" "Ṣ∧"Programming Puzzles"w|"Code"wṢw"Golf"w
```
[Try it online!](https://tio.run/nexus/brachylog2#@6@koPRw56JHHcuVAory04sSc3Mz89IVAkqrqnJSi5XKa5Sc81NSlcqBasqV3PNz0pTK////DwA "Brachylog – TIO Nexus")
### Explanation
```
" "Ṣ                                           If " " = Ṣ (which is itself " ")
    ∧"Programming Puzzles"w                    Write "Programming Puzzles"
                           |                   Else
                            "Code"w            Write "Code"
                                   Ṣw          Write " "
                                     "Golf"w   Write "Golf"
```
[Answer]
## [Alice](https://github.com/m-ender/alice), 44 bytes
```
/"floG!"t"edoC"#
 /"selzzuP gnimmargorP"d&o@
```
[Try it online!](https://tio.run/nexus/alice#@6@vlJaT766oVKKUmpLvrKTMpaCvVJyaU1VVGqCQnpeZm5tYlJ5fFKCUopbv8P8/AA "Alice – TIO Nexus")
Without whitespace:
```
/"floG!"t"edoC"#/"selzzuPgnimmargorP"d&o@
```
[Try it online!](https://tio.run/nexus/alice#@6@vlJaT766oVKKUmpLvrKSsr1ScmlNVVRqQnpeZm5tYlJ5fFKCUopbv8P8/AA "Alice – TIO Nexus")
### Explanation
In the first program, the two mirrors `/` redirect the instruction pointer onto the second line. `"selzzuP gnimmargorP"` pushes the required code points in revere order, `d` pushes the stack depth and `&o` prints that many bytes. `@` terminates the program.
Without the whitespace, the program is all on a single line. In that case, the instruction pointer can't move in Ordinal mode, so the `/` effectively become no-ops (technically, the IP simply doesn't move for one step, the same `/` gets executed again, and the IP reflects back to Cardinal mode). So if we drop those from the program, it looks like this:
```
"floG!"t"edoC"#"selzzuPgnimmargorP"d&o@
```
To include the space in `Code Golf`, we use an exclamation mark instead and decrement it with `t`. After we've got all the code points on the stack, `#` skips the next command, which is the entire second string. `d&o` then prints the stack again, and `@` terminates the program.
[Answer]
# PHP, 44 Bytes
ternary operator
```
<?=" "?"Programming Puzzles":"Code\x20Golf";
```
## PHP, 51 Bytes
comment
```
<?=/** /"Code\x20Golf"/*/"Programming Puzzles"/**/;
```
## PHP, 57 Bytes
array switch
```
<?=["Code\x20Golf","Programming Puzzles"][(ord("
")/10)];
```
[Answer]
# Common Lisp (SBCL), 52 bytes
```
(format`,t"~[Programming Puzzles~;Code~@TGolf~]"0 1)
```
Prints `Programming Puzzles`
```
(format`,t"~[ProgrammingPuzzles~;Code~@TGolf~]"01)
```
Prints `Code Golf`
Ungolfed:
```
(format t "~[Programming Puzzles~;Code Golf~]" 0 1)
```
Explaination:
The trick basically comes from how `#'format` works in Common Lisp.
In CL, most whitespace can be omitted provided that there is no ambiguity about where tokens start or end. The first trick was separating the `format` and `t` symbols. I had to unambiguously end the `format` symbol without changing how `t` was interpreted. Luckily, ` in CL ends the preceding token before it gets processed, and `,` cancels the effect of ` (` is used to implement templating, where the next expression following it gets "quoted", but any sub-expression prefixed with a `,` is evaluated and the result included in the template, so `, is nearly a no-op).
The third argument to `format` is the template string. `format` is similar to printf in C, but has much more powerful formatting directives and use ~ to indicate them instead of %. ~[ and ~] allow you to select between multiple options for printing, with ~; separating them. An additional argument is supplied to format- the numeric index of which one you want printed. In order to ensure that the " " in Code Golf survives, I used the tabulation directive ~T, which is used to insert whitespace, generally to align text into columns. ~@T is a variation which just inserts a given number of spaces, defaulting to 1.
Finally, there are two arguments to format- 0 and 1. Before whitespace is removed, the 0 is used by ~[~;~] to select "Programming Puzzles" and the extra format argument (the 1) is dropped (I'm not sure how standard dropping extra format arguments is, but this works on Steel Bank Common Lisp). After whitespace is removed, there is only one argument (01) which selects "Code Golf" instead.
[Answer]
# [Perl 5](https://www.perl.org/), ~~43~~ 41 bytes
```
say" "?"Programming Puzzles":Code.$".Golf
```
[Try it online!](https://tio.run/##bY7NCoJAFIX3PsVlEtqU1sKNEi0iWuYDDNSQNxVm7gw6o2j07Kb9QFDr853zHYOVjAZXI0TBar1KYKYJLlopQRnIknABrXYyg8oRtKUt4GzGCiz3Z88/beZDLToGbMvSSueVUKqkHFLX9xJrFu90hoHPgoOW12GeeCMMHzIG/3a6H501zsYs8bARctRPHlsgmBfldSFwyykMsylEpRuEtigt1kZc8LXI6b35fKid/SJiTpOH01/TLz88AA "Perl 5 – Try It Online")
Uses the fact that `' '` is true in perl and `''` is false. The `$"` variable is set to a space by default.
Thanks to @NahuelFouilleul for removing two bytes.
[Answer]
# R, 50 bytes
I think this is the same as [this Javascript answer](https://codegolf.stackexchange.com/a/117953), and basically the same idea as all the others.
```
`if`(' '=='','Code\x20Golf','Programming Puzzles')
```
[Answer]
# Pyth, 37 bytes
```
?" ""Programming Puzzles""Code\40Golf
```
[Try it here.](//pyth.herokuapp.com?code=?%22+%22%22Programming+Puzzles%22%22Code%5C40Golf)
```
?"""ProgrammingPuzzles""Code\40Golf
```
[Try it here.](//pyth.herokuapp.com?code=?%22%22%22ProgrammingPuzzles%22%22Code%5C40Golf)
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 42 bytes
With whitespace
```
\"floG"48*"edoC"
/>o<"Programming Puzzles"
```
[Try it online!](https://tio.run/nexus/fish#@x@jlJaT765kYqGllJqS76zEpW@Xb6MUUJSfXpSYm5uZl64QUFpVlZNarPT/PwA "><> – TIO Nexus")
Without whitespace
```
\"floG"48*"edoC"/>o<"ProgrammingPuzzles"
```
[Try it online!](https://tio.run/nexus/fish#@x@jlJaT765kYqGllJqS76ykb5dvoxRQlJ9elJibm5mXHlBaVZWTWqz0/z8A "><> – TIO Nexus")
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 50
```
[pq]sm[Programming Puzzles]dZ19=m[Code]n32P[Golf]p
```
[Try it online](https://tio.run/nexus/bash#S0mOT85PSbVV@h9dUBhbnBsdUJSfXpSYm5uZl64QUFpVlZNaHJsSZWhpmxvtDFQYm2dsFBDtnp@TFlvwX4krNTkjX0FJJQViipJCjUJKMkywGiqqr6@gXwuR@g8A).
`[ ]` defines a string - `Z` measures its length. If the length is 19 then it contains a space and the macro stored in the m register is called, which prints `Programming Puzzles` and quits. Otherwise `Code Golf` is printed.
[Answer]
# C# ~~88~~ ~~81~~ ~~70~~ 63 bytes
```
Func<string>@a=()=>" "==""?"Code\x20Golf":"Programming Puzzles";
```
With whitespace stripped:
```
Func<string>@a=()=>""==""?"Code\x20Golf":"ProgrammingPuzzles";
```
Thanks to BrianJ for showing me how to have no space between a method return type and the method name, PeterTaylor for saving ~~7~~ 18 bytes, and Patrick Huizinga for saving 7 bytes.
Same method as everyone else really, ~~technically this could be considered invalid because the method doesn't specify a return type for the method, but there *has* to be whitespace between the return type and the method name.~~
[Answer]
# Java 8, ~~74~~ ~~50~~ 48 bytes
```
()=>" "==""?"Code\040Golf":"Programming Puzzles"
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~47~~ 45 bytes
```
! v"floG!"1-"edoC"!
o<>"selzzuP gnimmargorP">
```
[Try it online!](https://tio.run/nexus/fish#@6@oUKaUlpPvrqhkqKuUmpLvrKTIlW9jp1ScmlNVVRqgkJ6XmZubWJSeXxSgZPf/PwA "><> – TIO Nexus")
*Thanks to [randomra](/u/7311) for -2 (clever two `!`s so that I can use only one `>o<`.)*
The code shouts "Flog! Flog! Flog!" and resembes a fish.
[Answer]
# [Befunge](https://esolangs.org/wiki/Befunge), 47 bytes
```
# <"floG"84*"edoC">:#,_@#" Programming Puzzles"
```
[Try it Online](https://tio.run/##S0pNK81LT/3/X1nBRiktJ99dycJESyk1Jd9Zyc5KWSfeQVlJIaAoP70oMTc3My9dIaC0qiontVjp/38A)
Without spaces it skip the first < and prints Code Golf instead
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~₄₅~~ ~~₄₁~~ 39 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous lambda. Takes dummy argument.
```
{'Programming Puzzles'
⊢4⌽9↑'GolfCode'}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24Rq9YCi/PSixNzczLx0hYDSqqqc1GJ1rkddi0we9ey1fNQ2Ud09PyfNOT8lVb0WpKV3DQA "APL (Dyalog Unicode) – Try It Online")
This function is a so called "dfn" which terminates with and returns the first non-assignment, i.e. `Programming Puzzles`.
Removing all whitespace gives:
```
{'ProgrammingPuzzles'⊢4⌽9↑'GolfCode'}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24Rq9YCi/PSixNzczLx0hYDSqqqc1GL1R12LTB717LV81DZR3T0/J805PyVVvRako3cNAA "APL (Dyalog Unicode) – Try It Online")
This takes the last nine characters of `GolfCode` thus padding with a trailing space, then cyclically rotates that 4 steps to the left. `⊢` ignores the text on its left and returns the text on its right.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~**72**~~ **68 bytes**
Had output backwards at first, thanks Draco18s, then saved 4 bytes, thanks Jo King
```
a=0;ab="Programming";a
b="Code";ad="Puzzles";a
d="Golf";print(ab,ad)
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P9HWwDoxyVYpoCg/vSgxNzczL13JOpELKOKcn5IKZKYA5UqrqnJSi0HiQJ57fk6aknVBUWZeiUZikk5iiub//wA)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 32 bytes
```
" "?`PžgŸmÚÁ Puzz¤s`:`Co¸{S}Golf
```
[Try it online!](https://tio.run/nexus/japt#@6@koGSfEHBoXvqh@bmHZx1uVAgorao6tKQ4wSrBOf/QjurgWvf8nLT//wE "Japt – TIO Nexus")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 56 bytes
```
('Programming Puzzles',('Code'+[char]32+'Golf'))[!(' ')]
```
[Try it online!](https://tio.run/nexus/powershell#@6@hHlCUn16UmJubmZeuEFBaVZWTWqyuo6HunJ@Sqq4dnZyRWBRrbKSt7p6fk6auqRmtqKGuoK4Z@///17x83eTE5IxUAA "PowerShell – TIO Nexus")
Pretty basic I would say, but it gets the job done
]