text:
Mapping between integer and pronounceable word
Purpose
The idea is to provide the code necessary to map a 32-bit integer to/from a pronouncable word of 9 characters maximum. That could be useful, for example, to make a serial number easier to remember, or type in a form.
Both the method for translating an integer to the corresponding word and for translating back a word to the corresponding integer are required.
Rules
There must be a one-to-one mapping between integers and words, and the whole set of 32-bit integers (or, put in another way, any integer from 0 to 4294967295) must be mappable. Although, obviously, not all words will be meaningful, and inputting words that don't map to an integer may have unspecified behavior.
You are free to decide on exactly which set of "pronouncable" words is meaningful, and how the mapping is done, but words must at least follow these rules:

Only the basic 26 letters (A...Z) should be used as characters. Accents, casing, etc... should not be used to extend the possible combinations.
9 characters maximum per word.
two consonants (BCDFGHJKLMNPQRSTVWXZ - 20 possiblities) should not be placed next to each other (they must be surrounded by vowels).
two vowels (AEIOUY - 6 possibilities) should not be placed next to each other (they must be surrounded by consonants).

Note: the simplest scheme where you have all words constructed as CVCVCVCVC (C being a consonant and V a vowel) gives 4147200000 combinations, and a 32 bit integer has 4294967296 possible values, so it is not enough. You need to expand the number of combinations, either by allowing shorter words, or by allowing VCVCVCVCV combinations, as well.
Other standard rules apply, and standard loopholes are forbidden.
Inputs/Outputs
For each submission, two pieces of code must be provided:

One that takes an integer as argument/input and returns/prints the corresponding word
One that takes a word as argument/input and returns/prints the corresponding integer

Alternatively, you can choose to submit a single piece of code that handles both operations:

When given an integer as an input, it outputs the corresponding word
When given a string as an input, it outputs the corresponding integer

Winning condition
This is a code-golf, the answer which has the fewest bytes (when summing both pieces of code, for solutions opting for the separated pieces of code) wins.

Are there any space or time constraints? Do we have to fit within 32GB of memory?

@JanDvorak Well, we should be able to test your program on a "standard" computer. But the algorithm should be simple, what do you have in mind that requires such a massive amount of memory?

I could just generate all possible nine-letter words that match your formula and then index into the set or do a binary search.

@JanDvorak I must admit I didn't think of that. I was more thinking about solutions that were basically doing base-26 conversions, with some adjustments to satisfy the vowel/consonant constraint. But I somehow doubt the "brutal" way you had in mind can be code-golf efficient. Anyway, if I must really clarify this, let's say you are not allowed to allocate more than 4GB of memory.

You could require the answerers to run their code for some predetermined values (0,1,10,2**32-1 and such) and then back and to include the results in the answer.

I can't provide test sets with corresponding integers and words, since you are free to choose the mapping method.

Related

Am I allowed to map only a specific subset of the words, e.g. all VCVCVCVCV and CVCVCVCVC words that do not start with A?

@eth yes, and you are even allowed to crash if ever the input word provided is not mapped.

JavaScript (ES6), 205 bytes
p=>(a='bcdfghjklmnpqrstvwxzaeiouy',1/p)?[...Array(9)].map(_=>r=a[p%(n=26-n)+(p=p/n|0,n<7)*20]+r,n=p>(p%=4e9)?20:6,r='')&&r:[...p].map(c=>r=r*(n=26-n)+a.search(c)%20,n=a.search(p[r=0])<20?6:20)&&r+(n<7)*4e9

Cutoff point between CVCVCVCVC and VCVCVCVCV is 4e9, so starts going wrong at 5244160000 (numeric input) or zesuwurib (string input).

Six months later... I award you the accept points, since you're the shortest (and I can't accept rturnbull's answer, which does not satisfies the clarification I made in the comments).

PHP, 353 Bytes
Encoding + Decoding
is_numeric($argn) contains the boolean. It is true if the input is an integer.
$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);if(is_numeric($a=$argn)){$r=($a)%26<6?$v[$a%26]:$c[$a%26-6];$a=$a/26^0;while($a){$z=count($t=in_array($r[0],$v)?$c:$v);$r=$t[$n=$a%$z].$r;$a=$a/$z^0;}echo$r;}else{for($p=1;$i++<strlen($a);){$u=($b=in_array($a[-$i],$c))?$c:$v;$s+=array_flip($u)[$a[-$i]]*$p+($b&$i<2?6:0);$p*=$i>1?count($u):26;}echo$s;}

PHP, 190 Bytes (Encode) + 195 Byte (Decode) = 385 Bytes
Encoding
$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);$r=($a=$argn)%26<6?$v[$a%26]:$c[$a%26-6];$a=$a/26^0;while($a){$z=count($t=in_array($r[0],$v)?$c:$v);$r=$t[$n=$a%$z].$r;$a=$a/$z^0;}echo$r;

5391360000=26*120**4 combinations are available
Online Version Encoding without E_NOTICE
Expanded
$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);
sort($c); # End of Prepare the two array
$r=($a=$argn)%26<6?$v[$a%26]:$c[$a%26-6]; #base 26 decision input mod 26 <6 end with vowel
$a=$a/26^0; #integer division input with 26
while($a){
    $z=count($t=in_array($r[0],$v)?$c:$v); # use vowel if last entry is consonant and viceversa
    $r=$t[$n=$a%$z].$r; # base 6 or base 20 decision
    $a=$a/$z^0; # divide through base
}echo$r; # Output result

Input => Output
4294967296 => TYPYQACOV
333 => DAT
1 => E
7 => C
4294967276 => UTOPOQAMI

If you need always 9 Byte result please replace while($a) with while(strlen($r)<9) + 10 Bytes
Decoding
$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);for($p=1;$i++<strlen($a=$argn);){$u=($b=in_array($a[-$i],$c))?$c:$v;$s+=array_flip($u)[$a[-$i]]*$p+($b&$i<2?6:0);$p*=$i>1?count($u):26;}echo$s;

Expanded
$c=array_diff(range("A","Z"),$v=["A","E","I","O","U","Y"]);
sort($c); # End of Prepare the two array
for($p=1;$i++<strlen($a=$argn);){
    $u=($b=in_array($a[-$i],$c))?$c:$v; # find use array for $a[-$i]
    $s+=array_flip($u)[$a[-$i]]*$p+($b&$i<2?6:0); # sum value
    $p*=$i>1?count($u):26; # raise multiple for next item
}echo$s;

Input => Output
ABABABABE => 1
E => 1
UTOPOQAMI => 4294967276
BABABADAT => 333
DAT => 333
TYPYQACOV => 4294967296

Online Version Decoding without E_NOTICE
Additional Check
If we need a check if a string is valid.
Add $x.=$b?:0; in the end of the decoding loop + 10 Bytes
Replace echo$s; with echo!preg_match('#([01])\1$#',$x)?$s:_; + 32 Bytes

R, 165 bytes
Encoding and decoding in one function.
This function uses the brute-force method of creating all possible values and then simply returning the index when it's given string input and returning the string when given integer input. As a consequence, it's very slow and uses 16GB+ of memory!
function(x){i=c(1,5,9,15,21,25)
d=apply(expand.grid(c<-letters[-i],v<-letters[i],c,v,c,v,c,v,c(c,"")),1,paste,collapse="")
`if`(mode(x)=="numeric",d[x],which(d==x))}

4,354,560,000 values are possible. This covers all strings of form CVCVCVCV(C), with the last C being optional.

@mbomb007 Gigabytes, sorry for the typo. The function does both encoding and decoding depending on whether the argument is a string or an integer. I've updated the post to clarify that.

Can the downvoter leave a comment to suggest improvement? Thanks.

In the comments of the question, dim clarifies that you cannot use more than 4gb of memory....


text:
deRpiFy tHe sTriNg!

yOu wiLl bE giVen A  sTriNg wHich cOnsiSts oF pRintAble asCii
  cHarActErs.
yOu iTeraTe tHrougH thE sTrIng tHen chAnge rAndOM(uNifoRm, 50% cHanCe uPPercAse) lEtteRs to
  uPPercAse aNd eVerytHing elSe tO lOwercAse.
tHat'S iT.

(sorry for the punctuation, it was for the concept of the question)
Readable version:

You will be given a string which consists of printable ASCII
  characters.
You iterate through the string and change random(uniform, 50% chance uppercase) letters to
  uppercase, and everything else to lowercase.
that's it.

exaMplEs
iNpuT => pOssiBle oUtPUt
Programming puzzles and Code Golf => pRogRaMMiNg pUzzlEs aNd coDe goLf
dErpity deRp derP => deRpiTy dErp DerP
CAAAPSLOOOCK => cAAapslOoocK
_#$^&^&* => _#$^&^&*

What does "randomly" mean exactly? Can there be two consecutive capital letters (your test cases don't have any such configurations)? I'd say this question is underspecified in its current state, but I'm not going to vote on it yet. Please specify these two things.

Is time%2 allowed for pseudorandomness?

@fəˈnɛtɪk Sure (if it is uniform)

Does the code have to lowercase it first, if doing so has zero effect because of how the following code works?

@BradGilbertb2gills it has to.

@SIGSEGV Don't contradict yourself. If you pass an all-uppercase string as input, you should still come out with a string that's derpified, right? Make that an example.

@mbomb007 added.

you say printable ASCII, but your test cases only include alphabetic characters. Should the program be able to deal with non-alphabetic characters, or can we expect the input to be purely alphabetic?

I think most of the existing answers also assume that the decision is independent for each letter, but that's nowhere in the question. At present I think it would technically be compatible with the spec to write something along the lines of (pseudocode) s=>rand()%2?s.upper():s.lower()

@PeterTaylor I disagree with that. The challenge explicitly states to iterate through the string and change random letters, uniformly, to either uppercase or lowercase. Your pseudocode doesn't do that.

@AdmBorkBork, I don't think the sentence which mentions randomness actually makes sense, so while I agree that your interpretation is the most likely to be the intended one I think that mine is also possible.

C – 65 bytes
Pretty good for a mainstream language!
main(c){while((c=getchar())>0)putchar(isalpha(c)?c^rand()&32:c);}

Uses XOR to randomly flip the bit at 0x20 for each alphabetic character. Program assumes ASCII character set and that EOF < 0.
Sample run on its own source!
$ main < main.c
MaIN(c){WhILe((C=GETChAr())>0)pUtCHaR(iSALpha(C)?C^rANd()&32:C);}

Very derpy.

"Pretty good for a mainstream language!" - C is often surprisingly good for golfing.

JavaScript, 87 bytes
function(s){return s.replace(/./g,c=>Math.random()<.5?c.toLowerCase():c.toUpperCase())}

68 bytes in ES6:

f=
s=>s.replace(/./g,c=>c[`to${Math.random()<.5?`Low`:`Upp`}erCase`]())
<input oninput=o.textContent=f(this.value)><pre id=o>

the second code does work but the first one: Uncaught SyntaxError: Unexpected token (

@FeloVilches You have to use it in an expression context for it to work, otherwise the engine tries to parse it as a function statement.

Can be shortened using ES6.

@CalculatorFeline To 68 bytes, no doubt?

MATL, 13 12 bytes
"@ktXkhlZr&h

Try it at MATL Online
Explanation
        % Implicitly grab input as a string
"       % For each character...
  k     % Convert to lowercase
  tXk   % Make a copy and convert to uppercase
  h     % Horizontally concatenate these two characters
  lZr   % Randomly select one of them
  &h    % Horizontal concatenate the entire stack
        % Implicit end of for loop and implicit display

Jelly, 6 bytes
,ŒsXµ€

Try it online!
How?
Lower casing all chars of the input and then uppercasing each with 50% probability is the same as choosing one of the original char and the swapped-case char with equal probability...
,ŒsXµ€ - Main link: string s
    µ  - monadic chain separation
     € - for each char c in s
,      -     pair c with
 Œs    -     swapped case of c
   X   -     choose a random item from the list (of the two chars)
       - implicit print

Ohh. Clever interpretation of the challenge.

By the way: is this uniform?

@SIGSEGV If by "uniform" you mean each char has a 50% chance of being each case then yes - X is implemented using Python's random.choice, so when presented with a list of 2 chars will pick each with 50% probability - every char in the input produces such a list (non-alphabetic chars will be a list of 2 equal chars, but that does not matter if the interpretation of "uniform" above is correct).

Here is an example of line feed separated lists from which one char of each would be chosen.

PowerShell, 64 60 bytes
-join([char[]]"$args".ToLower()|%{"$_".ToUpper(),$_|random})

Try it online! (make sure that "disable output cache" is checked if you want random results)
Exact translation of the challenge. Takes the input string, ToLower()s it, converts it to a char array, loops through each character |%{...}, and randomly selects between either the existing character or the uppercase variant. Then -joins them all back together into a single string. This works because ToUpper and ToLower only affect alphabetical characters, leaving punctuation and the like unchanged.
(Dennis fixed the alias list on TIO so that Random isn't trying Linux random but correctly aliases to Get-Random as a PowerShell command, as it should. Thanks, Dennis!)

PHP, 53 Bytes
for(;a&$c=$argn[$i++];)echo(lu[rand()&1].cfirst)($c);

Nice trick w/ the strto.*.er. :)

Save a byte w/ rand()&1

Save a bunch of bytes by using foreach(str_split($argv[1]as$c)... instead of array indexing.

Japt, 10 bytes
®m"uv"gMq2

Try it online!
Explanation
So this is kind of a cheesy hack, but it works. In JavaScript you can do something like
x[`to${Math.random()<.5?"Upp":"Low"}erCase`]()

to randomly convert x to upper- or lowercase. In Japt, the equivalent functions are u for toUpperCase and v for toLowerCase. But in Japt there is no direct way to get a calculated property value (x[expression] in JavaScript).
One of my favorite features of Japt is that if you have a function which is composed of a single method call (e.g. mX{Xq}, or .m(X=>X.q()) in JS), you can leave out everything except the name of the method, e.g. mq. The compiler then turns this into a string which gets passed to the original method call (.m("q")), and the method turns this back into a function. So there's no difference between mq and m"q"; both produce the same output.
Now, where I was going with this: while we can't directly call a random method on a string, we can call m on that string with a random method name. So, for the explanation:
®m"uv"gMq2
®           // Replace each char in the input by this function:
 m          //   Replace each char in this char by this function:
      g     //     the char at index
       Mq2  //       random integer in [0,2)
  "uv"      //     in "uv".
            //   This randomly calls either .u() or .v() on the char.
            // Implicit: output result of last expression

Doesn't Mq default to 2? Or was that recently added?

@obarakon I think that was more recent. A quick search on GitHub says it was May 5

Perl 5, 26 bytes
25 bytes + -p flag.
s/./rand 2&1?uc$&:lc$&/ge

Try it online!

Perl 6,  32  29 bytes
{[~] .comb.map:{(.lc,.uc).pick}}

Try it
{S:g/./{($/.uc,$/.lc).pick}/}

Try it

MATL, 12 11 bytes
1 byte removed using Jonathan Allan's idea of directly changing case.
"@rEk?Yo]&h

Try at MATL online!
Explanation
"         % Implicit input. For each
  @       %   Push current char
  r       %   Random number uniformly distributed on (0,1)
  Ek      %   Duplicate, floor: gives 0 or 1 with the same probability
  ?       %   If nonzero
    Yo    %     Change case. Leaves non-letters unaffected
  ]       %   End
  &h      %   Horizontally concatenate evverything so far
          % Implicit end and display

Python 2, 77 74 bytes
lambda s:"".join(map(choice,zip(s.upper(),s.lower())))
from random import*

Try it online!

Japt, 12 10 bytes
£M¬?Xv :Xu

Explanation:
£M¬?Xv :Xu
£             // Iterate through the input. X becomes the iterative item
 M¬           // Return a random number, 0 or 1
    ?         // If 1:
     Xv       //   X becomes lowercase
        :     // Else:
         Xu   //   X becomes uppercase

Try it online!

05AB1E, 8 bytes
vyDš‚.RJ

Try it online!
Explanation
v          # for each char y in input
 yDš‚      # pair lower-case y with upper-case y
     .R    # pick one at random
       J   # join to string

JavaScript, 77 bytes
x=>x.toLowerCase().split``.map(y=>Math.random()*2|0?y:y.toUpperCase()).join``

Try it online!

CJam, 14 bytes
qel{2mr{eu}&}%

Try it online!
Explanation
q               e# Read the input
 el             e# Make it lowercase
   {            e# For each character in it
    2mr         e#  Randomly choose 0 or 1
       {eu}&    e#  If 1, make the character uppercase
            }%  e# (end of block)

Pyth, 5 bytes
srLO2

Test suite
srLO2
srLO2Q    Variable introduction
  L  Q    Map over the input
 r        Set the case of each character to
   O2     Random number from [0, 1]. 0 means lowercase, 1 means uppercase.
s         Concatenate

Befunge, 136 bytes
>~:0`!#@_:"@"`!#v_:"Z"`!#v_:"`"`!#v_:"z"`!#v_,
^,<    <        <                 <
 >?<                     <             -*84<
  >84*+^

Try it online!
There is a lot of whitespace that I think is possible to get rid of. Befunge doesn't have a way of figuring out what's a letter and what isn't, so this is what I'm doing on the first row.

This snippet is a faster way of checking if the top value of the stack is a letter - pushes a 0 if it is, and a 1 if it isn't. It's a lot shorter to "and" conditions together by multiplying them instead of using a bunch of if statements routing to the same place

I don't understand how that works. When I run it, it always gives me a 0, and it doesn't accept any input.

Sorry, in that program you put the value in the first quotation marks. In retrospect, this is a really dumb way to do that. It should be pretty easy to change the first three characters to a ~

Swift - way too many bytes (176 167)
uppercased(),lowercased(),arc4random_uniform() really kill the score, besides for me having to add a function since Swift has no standard input method!
import Foundation
func g(x:String){var result="";for i in x.characters{let e=String(i);result+=(arc4random_uniform(2)>0 ?e.uppercased():e.lowercased())};print(result)}

Function with usage: print(g(x: "Your String Here"))

Bash, 64 bytes
first try

a=$(shuf -e -n 13 {A..Z}|tr -d "\n");b=${a,,};tr $b $a <<<${1,,}

Try it online!
shuffles capital letters, takes first 13, removes newlines and saved to $a.
$b holds $a to lowercase.
input is set to lowercase by ${1,,} and passed as a heredoc to tr which replaces each ocurrence of $b by $a
This is somewhat non compeating because the same letter is always capitalized.

JavaScript + HTML, 115 bytes

<input oninput="this.value=this.value.toLowerCase().split('').map(v=>Math.random()<.5?v.toUpperCase():v).join('')">

Bash, 162 Bytes
a=$1
b=1
c="echo $a|head -c$b|tail -c1"
while(($b<=${#a}))
do
r=$[RANDOM%2]
if [ $r = 1 ]
then d=$(eval $c);echo -n ${d^}
else echo -n $(eval $c)
fi
b=$[b+1]
done

Pretty self explanatory.  Takes input from command line arg, writes to stdout.
Run like derpifier.sh "Derp this"
Man, once I start applying the tips the code shrinks fast.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Detect the Nearly Perfect Licence Plates
Note: This is inspired by this question by @Willbeing where task was to count the number of perfect plates of a certain length, but it's slightly different.

We call a perfect licence plate that plate whose text satisfies the following conditions:

It consists of characters, which can either be uppercase letters([A-Z]) or digits([0-9])
Summing the positions of its letters in the English alphabet, 1-indexed (i.e: A=1,B=2,...,Z=26) gives an integer n
Getting each chunk of digits, summing them and then multiplying all the results gives the same result, n
n is a perfect square (e.g: 49 (72), 16 (42))

A nearly perfect licence plate meets the conditions for a perfect licence plate, except that n is not a perfect square.

Input
A string representing the text of the licence plate, taken as input in any standard form, except for hardcoding.
Output
If the given string represents a nearly perfect licence plate, return a truthy value (e.g: True / 1), otherwise return a falsy value (e.g: False / 0). Any standard form of output is accepted while taking note that this loopholes are strictly forbidden.

Examples
licence plate -> output

A1B2C3 -> 1

A + B + C = 1 + 2 + 3 = 6
1 * 2 * 3 = 6
6 is not a perfect square, 6 = 6 => nearly perfect plate

01G61 -> 1

(0 + 1) * (6 + 1) = 7
G = 7
7 is not a perfect square, 7 = 7 => nearly perfect plate

11BB2 -> 0

(1 + 1) * 2 = 4
B + B = 2 + 2 = 4
4 = 4, but 4 is the square of 2 => perfect license plate (not what we want)

67FF1 -> 0

(6 + 7) * 1 = 13
F + F = 6 + 6 = 12
12 != 13 => not perfect at all!

Scoring
This is code-golf, so the shortest answer in bytes wins!

[tag:popularity-contest]

I think this would be better as [tag:code-golf].

Let me make sure I understand this. We only output truthy if the licence plate is perfect and n is not a perfect square?

@mathjunkie Yes. TL;DR: only if the licence is nearly perfect (P.S sorry for the late response)

Before anyone does s/licence/license/ig on this, be aware that "licence" is the correct spelling in British English (as well as English in other parts of the world).

Jelly, 29 28 30 bytes
+1 byte to fix a bug spotted by ChristianSievers (incorrectly dealing with substrings of only zeros)
+1 byte to fix false positives for "0", "00", ... found during above fixing (0 is a perfect square).
i@€ØAS;Æ²$
e€ØAœpV€€LÐfS€P;0⁼Ç

Try it online!, or run tests
How?
i@€ØAS;Æ²$ - Link 1: [letter-sum, letter-sum is perfect square?]: plate
i@€        - index of €ach char in plate [reversed @rguments] (1-based, 0 otherwise) in:
   ØA      -     uppercase alphabet
     S     - sum
         $ - last two links as a monad:
      ;    -     concatenate with:
       Æ²  -         is square?

e€ØAœpV€€LÐfS€P;0⁼Ç - Main link: plate                        e.g. "11BB2"
    œp              - partition plate at truthy values of:
e€                  -     is in? for €ach char in plate:
  ØA                -         uppercase alphabet                   [['1','1'],[''],['2']]
      V€€           - evaluate for €ach for €ach                   [[1,1],[],[2]]
          Ðf        - filter keep:
         L          -     length                                   [[1,1],[2]]
            S€      - sum each                                     [2,2]
              P     - product                                      4
               ;0   - concatenate a zero                           [4,0]
                  Ç - last link (1) as a monad (taking plate)      [4,1]
                 ⁼  - equal? (non-vectorising)                     0

Wow, genius Jelly solution!

What about 11AA0?

@ChristianSievers, good catch. Fixed along with another, kind of related, bug and extended the test suite.

MATL, 36 34 33 35 bytes
3Y432YXU"@V!Usvp]GlY2&msy=wtQ:qUm~v

Try it at MATL Online
Explanation
        % Implicitly grab input as a string
3Y4     % Push the predefined literal '[A-Za-z]+' to the stack
32      % Push the literal 32 to the stack (ASCII for ' ')
YX      % Replace the matched regex with spaces (puts a space in place of all letters)
U       % Convert the string to a number. The spaces make it such that each group of
        % of consecutive digits is made into a number
"       % For each of these numbers
  @V!U  % Break it into digits
  s     % Sum the digits
  v     % Vertically concatenate the entire stack
  p     % Compute the product of this vector
]       % End of for loop
G       % Explicitly grab the input again
lY2     % Push the predefined literal 'ABCD....XYZ' to the stack
&m      % Check membership of each character in the input in this array and
        % return an array that is 0 where it wasn't a letter and the index in 'ABC..XYZ'
        % when it was a letter
s       % Sum the resulting vector
y       % Duplicate the product of the sums of digits result
=       % Compare to the sum of letter indices result
w       % Flip the top two stack elements
Q       % Add one to this value (N)
t:      % Duplicate and compute the array [1...N]
q       % Subtract 1 from this array to yield [0...N-1]
U       % Square all elements to create all perfect squares between 1 and N^2
m~      % Check to ensure that N is not in the array of perfect squares
v       % Vertically concatenate the stack.
        % Implicitly display the truthy/falsey result

Yields false positives for plates consisting of only zeros, e.g. '0' or '00' (FWIW I just fixed that in my code too).

@JonathanAllan Updated.

Python 2, 120 118 bytes
s=t=p=0;r=1
for n in input():
 h=int(n,36)
 if h>9:s+=h-9;r*=t**p
 p=h<10;t=(t+h)*p
print(s==r*t**p)&(int(s**.5)**2<s)

Try it online!
Interprets each character as a number in base-36 (h). Converts to decimal and adds to the sum if h>9 (meaning it's a letter), otherwise adds to a variable which gets multiplied to form the running product later.

Python 2, 267 207 bytes
 Saved 60 bytes thanks to ovs
import re
def g(l):a=reduce(lambda a,b:a*b,[sum(map(int,list(i)))for i in re.sub(r'\D',' ',l).split()],1);return a==sum(sum(k)for k in[[ord(i)-64for i in x]for x in re.sub(r'\d',' ',l).split()])and a**.5%1>0

Function with usage: print(g('A1B2C3'))
Try it online!

Some minor improvements

Python 3, 163 156 155 164 161 bytes
from math import*
m=1;s=t=p=0
for x in input():
 try:t+=int(x);p=1
 except:m*=[1,t][p];p=t=0;s+=ord(x.upper())-64
if p:m*=t
print(m==s and sqrt(m)!=int(sqrt(m)))

Try it online!

saved 7 bytes thanks to  Jonathan and Shooqie
saved 1 byte: Also Fixed the false positive issue. Thanks to  Jonathan for pointing it out!
added 11 bytes: Previous edit was wrong(the multiplication of sum of digit was going on in an unwanted loop)

from math import* is shorter

You don't need a, just use for x in input():. You can have false positives for plates ending with a string of zeros (e.g. 11AA00), since the  final m*=t is not executed.

Apparently, my code shows false positive for any string with isolated zeros in it ( 3A0B is also shown true )... Thanks for pointing that out @JonathanAllan. I will try to fix it.

Check the newer version... I have added a new flag variable 'p' to decide whether or not to multiply the sum of digits.

Perl 5, 80 bytes
79 bytes of code + -p flag.
$.*=eval s/./+$&/gr for/\d+/g;$t-=64-ord for/\pl/g;$_=$.==$t&&($.**.5|0)**2!=$.

Try it online!
$.*=eval s/./+$&/gr for/\d+/g; multiplies the sums of consecutive digits. (I'm using $. because it's initial value is 1, which mean it's the neutral element for multiplication). More precisely, for each chunk of digits (for/\d+/g), s/./+$&/gr places a + before each digit, then the string is evaluated, and multiplied with the current product.
Secondly, $t-=64-ord for/\pl/g; sums in $t each letter (for/\pl/g). (ord return the ascii code for the letter, and 64-.. makes it be between 1 and 26.
Finally, $.==$t checks that both values are the same, and ($.**.5|0)**2!=$. that it's nor a perfect square.

Retina, 143 bytes
Returns 1 for true, 0 for false

[1-9]
$*
10|01
1
S_`(\D)
O`
{`1(?=1*\n(1+))
$1
)2=`1+\n

[J-S]
1$+
[T-Z]
2$+
T`0L`ddd
1>`\d+\n?
$*
^((?(1)((?(2)\2(11)|111))|1))*\n

^(1*)\n\1$

Try it Online!
Explanation:

[1-9]
$*
10|01
1

First, we replace all non-zero digits with their unary representation. We remove any zeroes with an adjacent digit so that they don't affect our unary operations

S_`(\D)

Split the resulting string on letters, being careful to exclude empty lines (this is a problem when two letters are consecutive AA).

O`
{`1(?=1*\n(1+))
$1
)2=`1+\n

Sort the string lexicographically. Then repeatedly do the following:
1) Replace each 1 with the number of 1s on the following line (this mimics multiplication)
2) Remove the second line of 1s

[J-S]
1$+
[T-Z]
2$+
T`0L`ddd

Replace letters J-S with 1J, 1K, etc. and replace letters T-Z with 2T, 2U, etc. Then, replace each of the groups A-I, J-S, and T-Z with 1-9. We will be left with the numerical value of each letter (eg. 13 for M).

1>`\d+\n?
$*

Convert every line but the first into unary (the first line is already in unary). Concatenate these lines. We are now left with a string of the form <product of digits>\n<sum of letters>.

^((?(1)((?(2)\2(11)|111))|1))*\n

Replace a square number with the empty string. This uses the "difference tree" method.

^(1*)\n\1$

Return 1 if the two strings on either side of the \n match. Otherwise, return 0.

False positives for 11AA0, 0AA11, etc.

@JonathanAllan Thanks! It cost me 11 bytes to fix

Ruby, 87 bytes
->s{m=0
n=1
s.scan(/(\d+)|./){$1?n*=$1.bytes.sum{_1-48}:m+=$&.ord-64}
m==n&&m**0.5%1>0}

Attempt This Online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Create a codeblock tool
When using Markup, like on the SE network, an indentation of four spaces before a line of text denotes it as part of a code block, as I hope you know. If you don't, here's an example (with . representing a space):
....Code
....More code
results in
Code
More code

The problem is, when you copy-paste code into an answer, you need to indent each line manually. This is especially difficult when working with ungolfed code, as it's likely already indented and can cause confusion. You can just select your code and hit Ctrl + K, it turns out. Hours of my life wasted for no reason aside...
So, your goal is, given an input, return it with four spaces before each line. In the spirit of saving time copy-pasting, you are to process the entire input as a single string (so long as your language can parse it). If your language is unable to process a character (such as newlines) in strings, you may assume it is denoted/escaped through some other method supported by the language; however, the output must output each line on its own line (so no passing something like ....foo\n....bar).
Standard loopholes not allowed. As this is code-golf, the shortest answer in bytes wins. Good luck!

"you need to indent each line manually" (or select the text and click the button :))

@JonathanAllan "Button"? Surely you mean "keyboard shortcut". (Ctrl+K)

@JonathanAllan ...I... I am very upset. SO MUCH TIME. WASTED.

I find mashing my big trackpad easier than finding two keys, but hey each to their own

Must the output be printed, or is a list of strings acceptable?

@GregMartin It can be output however you like, but said output must be copy-pastable without altering the input (wrappers aside). In other words, so long as it's identical to just using Ctrl + K, go for it.

While I'm fairly confident that Kritixi's V answer won't be beaten, I would typically recommend waiting a bit longer before accepting an answer, because accepting so early poses a disadvantage to people who could answer with a shorter answer but weren't on the site at the time (timezones or just not always being on PPCG 24/7)

@HyperNeutrino Right. I did take that into account, but...
I mean, 6 bytes?! I'm pretty sure even some HQ9+ answers use more. [In the meantime, though, I'll wait until they at least change the bytecount to reflect Unicode as well.]

It's 4 now, so it's probably not going to be beaten, but you never know.

you are to process the entire input as a single string Do you mean that the program must accept the input as a whole but can get it char-by-char or line-by-line or anything or that the program must actually load the whole input in memory at once before processing it?

+1 for informing people about Ctrl + K

So is it kay with tab spacing. Without ctrl+k is nothing but a tab!

@KoishoreRoy Thank Johnathan Allan and Martin Ender. I had no clue (hence the strikethrough [which apparently doesn't work in comments, no matter which method you try]).

I prefer to copy a tab and paste it in front of each line, unless my code is long.

@HyperNeutrino If they aren't on PPCG 24/7, they don't deserve to win :P

Puzzle still valid if you want to insert code after a list item.

@Papayaman1000 wh... WHAT THE $@#* I'M ANGRY AS HELL TOO.

just do \``\ncode\n```where\n` is a newline.

V, 4 bytes
Î4É

Try it online!
(Note the trailing space)
V is encoded in Latin1, where this is encoded like so:
00000000: ce34 c920                                .4.

Explanation
Î            " On every line
 4É<space>   " Prepend 4 spaces

Here's a solution that is also 4 bytes in UTF-8!
VG4>

VG          " Select everything
   >        " Indent
  4         " 4 times (with spaces)

Hope somebody picks up that phone, cause wow did someone call it.

Alternate solution: 4ñ>G

@DJMcMayhem But it uses tabs to indent instead of spaces

In vim, yes. In V, no, it's 4 spaces

@DJMcMayhem Thanks, that inspired another alternative solution that is only 4 bytes in UTF-8!

Couldn't VG> work assuming softtabs and tab length = 4 is set?

@Downgoat Probably, but vim-golf assumes that .vimrc is not loaded, so that you cannot have special mappings for certain keystrokes or what you said by modifying the default settings

Crayon, 7 bytes
`¤q;3xq

Try it online!
Explanation
Crayon is a stack-based language designed for creating ASCII-art. It's still in the early stages of development, but it knows just enough to finish this challenge with a rather low byte count:
         Implicit: input string is on the stack
`¤       Push a non-breaking space to the stack.
  q;     Draw this at the cursor (0,0 by default) and pop it.
    3x   Move three more spaces to the right.
      q  Draw the input string here (at 4,0).
         Implicit: output the canvas, trimmed to a rectangle

Drawing the non-breaking space is necessary because Crayon automatically trims the output to a rectangle, so without the NBSP it would just print the original input.

Would Crayon let you do the opposite: output the string, then move four spaces to the left and output a nbsp? That's likely to cost less in stack manipulation, although I don't know whether Crayon would correctly move the canvas into the right place.

@ais523 Hmm, that's a really good idea... unfortunately, that'd require moving to x=-4, which is not an easy task at the moment. I really should push these changes I've been working on for a month... :P

Retina, 8 bytes
%`^

Try it online!
There are four spaces on the second line. Alternative solutions use either m`^ or %1` or 1%` on the first line. All of these match the position at the beginning of each line and replace it with four spaces.

I suspected a Retina answer would be first.

Well that was fast.

@Neil I'll be surprised if this doesn't get beaten by V (or even raw Vim). :)

@MartinEnder Here ya go (4 bytes in V): http://codegolf.stackexchange.com/a/115870/41805 :)

Cheddar, 31 bytes
@.lines.map(("    ":+)).asLines

Really simply, but I posted because it shows off the new functional operators.
("    ":+) is the same as A -> "    " + A. (i.e. + op as a function with "     " bound to LHS).
I don't think even needs explanation

Oh did you change how the parser works? From what I remember : would cause problems with ?:

@ConorO'Brien I kinda forgot how I fixed it but I believe that because there's a : with no matching ?, the parser will choose to treat it as a functional op. This still requires the functional op to be wrapped in parens but yeah

+1 for smiley :+)

What does @ mean?

Python,  44  39 bytes
Crossed out  44  is no longer 44 :)
-5 bytes thanks to ovs (avoid dequeue with a prepend)
lambda s:' '*4+s.replace('\n','\n    ')

Try it online!

lambda s:' '*4+s.replace('\n','\n    ') for 39 bytes

@ovs - I don't see it... do you mean lambda s:' '*4+s.replace('\n','\n ')[1:] for 40 (which does not work) or something else?

Just lambda s:' '*4+s.replace('\n','\n<4 spaces>') TIO

@ovs Ah yes, of course (the comment four space markdown rendering threw me and I didn't notice it in my reply either) thanks for the saving!

JavaScript, 26 bytes
Thanks @Conor O'Brien for golfing off 8 bytes
x=>x.replace(/^/gm,"    ")

Replace with a regex with /g replaces all instances. m makes the regex treat each line separately for the start of the string ^.
Try it online!

It seems to jumble non-whitespace in the input into asdf repeated over and over.

You should note what I had put as the input in TIO

You can save a few bytes by doing x=>x.replace(/^|\n/g,"$&    ") to get the first line and the following lines all in one go

Ah. The footer.

26 bytes: Try it online!

Or ^ works too I guess ;-)

Jelly, 8 bytes
Ỵṭ€⁶ẋ4¤Y

Try it online!
How?
Ỵṭ€⁶ẋ4¤Y - Main link: string
Ỵ        - split on newlines
      ¤  - nilad followed by ink(s) as a nilad:
   ⁶     -     a space character
    ẋ4   -     repeated four times
 ṭ€      - tack for €ach
       Y - join with newlines

Some other 8 byte variants are:
Ỵṭ€⁶Yµ4¡ (4 repeats of split on newlines, tack a single space);
⁶ḤḤ;Ð€ỴY (doubling twice is like multiplying by 4, Ð€ maps over the right argument, so we can concatenate instead of tacking);
and other rearrangements thereof.

Python 2, 87 45 bytes
print' '*4+'\n    '.join(input().split('\n'))

Input is taken as 'Line1\nLine2\nLine3...' (Quotes necessary)
Thanks to @WheatWizard for giving me an idea that helped me golf 42 bytes.

I grew up on python. That's what made me think this would be sort of hard. Even ignoring RegEx, I was so wrong, turns out.

@Papayaman1000 It's a fairly trivial challenge, both with and without RegEx, though I find it to be very interesting.

I will admit, since I didn't know about Ctrl + K, the real reasons for this challenge being proposed were... less than for just pure puzzling.

@Papayaman1000 Haha, yes, it was quite annoying having to press space 4 times in front of each line. Especially since I usually use Python and so I have multiple lines all the time (it's not so bad when I used to use Java). Eventually I just got lazy and used my text editor to replace ^ with  .

Why don't you join along '     \n' instead of all of the extra nonsense?

@HyperNeutrino Let's continue this in chat, shall we?

It saves 48 bytes, tio.

@WheatWizard Thanks, but that doesn't work. It has the spaces at the end.

umm...why am I getting a downvote here? This doesn't appear to be invalid...

Thats because I added an extra \n I was testing if it worked for an empty line.

@WheatWizard Thanks for the suggestion, I golfed it down a bit. Is it a bit better now?

Emacs, 5 keychords, 5 bytes
C-x h M-4 C-x tab

In at least one commonly used encoding for keyboard entry, each of these keychords is a single byte: 18 68 b4 18 09. Emacs entries tend to be very keychord-heavy, as each printable ASCII character stands for itself except as a subsequent character of a multi-character command (meaning that only keychords can be used to give actual commands).
I'm not sure how this compares to Vim (as opposed to V). But Vim is fairly commonly used on PPCG, and so I thought the other side of the editor wars deserves its time in the spotlight too.
This assumes that I/O is done via the buffer (the equivalent of the normal I/O conventions for vim), or taken from a file and output onto the screen (which comes to the same thing). If you do I/O via the region instead, which is natural for some forms of program, you can remove the leading two characters, for a score of 3 bytes; however, I don't think that complies with PPCG rules.
Explanation
C-x h M-4 C-x tab
C-x h               Specify the entire buffer as the region
      M-4           Give the argument 4 to the next command that runs
          C-x tab   Increase the indentation level of each line by a constant

The last builtin used here is, of course, incredibly useful for this challenge; the rest is just structure.

PowerShell, 29 28 Bytes
"$args"-split"
"|%{" "*4+$_}

-1 Thanks to fergusq, using an actual newline instead of the `n
takes the "$args" input as a string (cast using "s) and -splits it on a newline, then loops (%{}) through it, appending four spaces (" "*4) and the line ($_) then outputs it implicitly.

Can you use a newline character instead of `n?

@fergusq indeed I can, updated.

Presumably the newline character is \r\n on windows which is still two bytes - or are there rules clarifying how many bytes a newline character takes?

@poizan42 I'm not sure if there's a meta post on it, but I can run this in the default console with just the newline so there's no reason to consider it invalid.

Pyth, 10 Bytes
jm+*4\ d.z

Try it!
If input as a list of lines would be allowed, I could do it in 7 bytes:
jm+*4\

Try that
longer solutions:
12 Bytes:
+*4d:Eb+b*4d

12 Bytes:
+*4dj+b*4d.z

13 Bytes:
t:E"^|
"+b*4d

Got it down to 9: jbm*4\ .z

@ConfusedMr_C That just overwrites every line with 4 spaces.

I forgot the d, whoops. Your 10 byte answer is what I was going for, anyway

Röda, 21 bytes
{(_/"
")|[`    $_
`]}

Try it online!
It is an anonymous function. The input is pulled from the stream.
Explanation:
{
    (_/"\n") |        /* Splits the input at newlines */
    ["    ".._.."\n"] /* For each line, prints four spaces before the line */
}

Does identity() just pull all values from STDIN?

@KritixiLithos Yes. identity pulls values from the input stream and pushes them to its output stream. It is identical to push(x) for x.

Perl 5, 11+1 = 12 bytes
11 bytes of code + -p flag.
s/^/    /mg

Try it online!
For once, explanations will be short: The regex replaces each beginning of line (^ combined with /m modifier) by four spaces - the end.

This reads input a line at a time, rather than a string as a whole.

@ais523 Roughly half of the answers, including the top two, read input in the exact same way.

@ais523 I'd say it processes the input one line at a time, but it can read it as a whole string (if you supply it with <<< "..." for instance). Don't you agree?

@ais523 after thinking a bit more about it, I think you're right. (I've update my code accordingly)

sed, 16 10 9 bytes
s/^/    /

Try it online!
Edits
Reduced solution size from 16 to 10 bytes thanks to Kritixi Lithos.
-1 byte thanks to seshoumara.

You can get to 15 bytes by using the -r flag (1 byte) so that you can remove the backslashes before the parentheses.

You can get to 13 by using s/.*/    &/ (remove the parentheses and replace \1 with &)

@KritixiLithos Thanks! It works even without *.

Or simply s:^:    :, for 9 bytes.

@seshoumara I've never seen colons used this way in a sed script... Do you know which part of the manual describes this syntax?

It's a habit of mine, so the code can be of course s/^/    / also. You can use other character besides /, as described here. I ended up using colons so I don't have to escape a literal '/'.

@seshoumara Thanks for the tip! Didn't know that it's possible to use any other character as a separator.

For many more tips and discussions about sed, and bash in general, pass by the bash, sed and dc chat room, if interested.

Perl 6, 11 bytes
*.indent(4)

Try it
Expanded:
*\       # declare a WhateverCode lambda/closure (this is the parameter)
.indent( # call the `indent` method on the argument
  4      # with the number 4
)

Java 7, 58 bytes
String c(String s){return"    "+s.replace("\n","\n    ");}

Explanation:
Try it here.

Append with four leading spaces
Replace every new-line for a new-line + four spaces

I am forever sad that Java's regex mechanisms require other libraries for the most part.

I think you need replaceAll

@Khaled.K Why? Both .replace and .replaceAll will replace all occurrences of the searched String with the replacement. .replace is used for literal Strings, and .replaceAll for regexes. Since \n isn't a regex, .replace can be used without a problem to replace all newlines with a newline + four spaces, which you can also check in the "Try it line" link I provided.

Brain-Flak, 109 103 bytes
-6 thanks to Wheat Wizard
Includes +1 for -c
((()()()()()){}){(({}<>)[()()((()()()()){})]<(((((({}){}){}))))>){(<{}{}{}{}{}>)}{}<>}<>{({}<>)<>}<>{}

Try it online!
((()()()()()){})        # Add a newline to the beginning
                        # This is needed to get spaces infront of the first line)
{                       # For every character (call it C)
  (({}<>)               #   Move C to the other stack
  [()()((()()()()){})]  #   Push 8 and subtract 10 (\n) from C
  <(((((({}){}){}))))>) #   Push 4 spaces using the 8 from earlier
  )                     #   Push C - 10
  {(<                   #   If C - 10 != 0...
    {}{}{}{}{}          #     Pop the 4 spaces that we added
  >)}{}                 #   End if
  <>                    #   Switch stacks to get the next character
}                       # End while
<>{({}<>)<>}<>          # Reverse the stack (back to the original order)
{}                      # Pop the newline that we added

Moved some stuff around saved some bytes

... and two more bytes off

@WheatWizard Nice. I need to start looking for redundancies like that. It probably happens to me more than push pop does. Those are just automatic now. Thanks

J-uby, 17 16 Bytes
~:gsub&' '*4&/^/

Explanation
~:gsub           # :gsub with reversed arguments:
                 # (f)[regex,sub,str] == str.gsub(regex, sub)
      &' '*4     # replace with four spaces
            &/^/ # match the start of each line

This directly translates to (in Ruby):
->s{s.gsub(/^/,' '*4)}

PHP, 43 Bytes
<?="    ".strtr($_GET[0],["\n"=>"\n    "]);

Stacked, 13 bytes
'^'4' '*mrepl

Try it online!
Explanation
'^'4' '*mrepl      (* input: top of stack *)
        mrepl      perform multiline regex replacements,
'^'                  replacing /^/ with
   4' '*             four spaces

05AB1E, 7 5 bytes
Saved 2 bytes thanks to kalsowerus
¶¡4ú»

Try it online!
Explanation
¶¡        # split input on newline
  4ú      # prepend 4 spaces to each
    »     # join by newline

You can use | instead of ¶¡. https://tio.run/nexus/05ab1e#@19zeIPJ4emH1xza/f9/Uk4iFxAjKCACAA

@Okx: Unfortunately not, as the input had to be one string and not several inputs separated by newlines :(

Maybe a little late, but ð4×ì could be replaced by 4ú, does the exact same thing. Assuming that command was available back then.

@kalsowerus: The command was indeed available back then. Thanks :)

MATL, 12 bytes
10&Yb"4Z"@gh

Input is a string with newlines. To enter this, you need to concatenate character 10 between the normal characters to represent newline (square brackets are concatenattion):
['Code' 10 'More code']

Try it at MATL online!
Explanation
10&Yb   % Implicit input. Split at char 10 (newline). Gives cell array of strings
"       % For each
  4Z"   %   Push string of 4 spaces
  @g    %   Push the contents of current cell array, i.e. a string with one of the
        %   original lines
  h     %   Concatenate the two strings horizontally
        % Implicit end. Implicit display

CJam, 11 bytes
Thanks to @Challenger5 for a correction
qN/{S4*\N}%

Try it online!
Explanation
q              e#  Read whole input as a string with newlines
 N/            e#  Split at newlines, keeping empty pieces. Gives an array of strings
   {     }%    e#  Map this function over the array of strings
               e#  The current string is automatically pushed
    S4*        e#  Push a string of four spaces
       \       e#  Swap. Moves the original string after the four spaces
        N      e#  Push a newline
               e#  Implicity display stack contents

Doesn't work on abc\n\ndef. It returns ....abc\n....def because % discards empty elements. You want to use / to split instead, because it keeps the empty elements.

@Challenger5 Thanks, corrected!

Octave, 17 bytes
@(s)["    "';s']'

Try it online!

C, 66 65 bytes
p(){printf("    ");}f(char*s){for(p();*s;)putchar(*s++)-10||p();}

Try it online!

Neat solution, but you could go with s;char*l;f(){while(getline(&l,&s,stdin)+1)printf("____%s",l);} which 62 bytes

@Khaled.K Thanks, but that doesn't seem to work without including <stdio.h> (because of the stdin).

Vim, 6 keystrokes
<Ctrl-V>G4I <Esc>

Assumes that the cursor is on the beginning of the file, as if you opened the file from from the command line via  vim filename.
<Ctrl-V>            " Enter visual block move (enables rectangular selection)
        G           " Move to bottom line (selecting the entire first column)
         4          " Repeat the following action 4 times
          I         " Insert at start of (each selected) line
                    " [input a space]
            <Esc>   " Exit insert mode

With a vim configured to use 4 spaces for indentation it would be 2 keystrokes: >G.

I'm pretty sure you can remove the ZZ at the end. Usually vim submissions are fine just outputting to the buffer rather than to a file.

Alright thanks, I removed ZZ then.

PHP, 16
echo"    $argn";

run with php -R <code>. -R runs the given code for every input line and $argn is fed the current input line. So this simply prints each line with additional four spaces in front of it.

V, 3 bytes (Non-competing)
4>G

This is answer uses a feature that I have been planning on adding for a while, but just got around to adding today. That makes this answer non-competing and invalid for winning. But it's still cool to show off such a useful/competitive feature!
Try it online!
Explanation:
4>   " Add an indent of 4 to...
  G  "   Every line from the current line (0 by default) to the end of the buffer

Neat! At least take some pride in the fact that your language took the top spot even beforehand [even if it is a dirty golfing language... nah, jk]!

Japt, 7 6 bytes
Saved 1 byte thanks to @ETHproductions
miS²²R

Try it online!
Explanation:
miS²²R
m       // At each char in the input:
 iS²²   //   Prepend " " repeated 4 times
     R  // Rejoin with newlines

Nice job. S²² would work as well in place of Sp4, not that it saves you anything in this case. Speaking of which, I think you can just do miS²²R to remove the R flag (basically miS²², but split at newlines beforehand and join with newlines afterward)

UberGenes, 62 bytes
I had to enter this challenge with UberGenes, as a very similar program (that only inserted one space) was one of the first programs I ever wrote in the language, and it seemed like it would be easy to modify for this purpose.
=aA=p9=z4=cI=AC+a1-z1:pz=Ao:CA:Ii  =b5+b5-bA+a1=d3*d7:db=i0

How it works:
=aA                                                         Set a to 61
                                                            (Begin main loop)
   =p9                                                      Set p to 9
      =z4                                                   z counts spaces
         =cI                                                Set c to 61
                                                            (Jumping to p jumps here)
            =AC                                             Put the space at position 61
                                                              at position a.
               +a1-z1                                       Move a right and decrement z
                     :pz                                    Jump to p if z is nonzero
                                                            (Jumping to d jumps here)
                        =Ao                                 Read a character to position a.
                           :CA                              Jump to position 32+3 if input
                                                              was nonzero.
                              :Ii                           Otherwise, jump to position 61,
                                                              causing the entire string
                                                              that begins there to be
                                                              printed before halting.
                                                            (This is position 32+3=35)
                                   =b5+b5                   Set b to 10 (newline).
                                         -bA                Subtract the input character to
                                                              compare it with newline.
                                            +a1             Move a right.
                                               =d3*d7       Set d to 21
                                                     :db    Jump to d if not newline.
                                                        =i0 Jump back to begin main loop.
(The 3 spaces at the end position a space character at position 61 so that, after =cI,
C refers to the space character--it will also be the first space printed.)

Ruby, 22 21 Bytes
1 Byte saved thanks to @manatwork

->s{s.gsub /^/,' '*4}

Takes s, replaces all occurences of /^/ (start of line) with four spaces.

' '*4 is 1 character shorter.

Actually, 16 bytes
9uc;§s⌠' 4*+⌡M@j

Try it online!
Explanation:
9uc;§s⌠' 4*+⌡M@j
9uc;              push two newlines
    §s            raw input, split on newlines
      ⌠' 4*+⌡M    for each line:
       ' 4*+        prepend 4 spaces
              @j  join with newlines

Swift, 94 bytes
func f(g:String){print(g.components(separatedBy:"\n").map{"    "+$0}.reduce("",{$0+"\n"+$1}))}

This is a function, that can be used like this:
f(g:"YOUR\nSTRING")

Y'know for people golfing from their iPads.

GolfScript, 14 bytes
n/{' '4*\+}%n*

Try it online!
Note: if trailing newline is disallowed, append :n; for 17 bytes.

brainfuck, 57 bytes
++++[>>++++++++<<-]>+<,[>[->....<]+<.----------[>-<[-]],]

Online interpreter
You need to use \n for newlines, although they get parsed as actual newlines (input field at the bottom).
Set EOF = \0 (go to Options > End of input > char = \0).

I have asked OP for clarification if something like this is allowed.

Gema, 13 characters
/.*/=\     $0

Sample run:
bash-4.3$ gema '/.*/=\     $0' <<< $'Code\nMore code'
    Code
    More code

jq, 24 characters
(19 characters code + 5 characters command line options)
(./"\n")[]|"    "+.

Sample run:
bash-4.3$ jq -sRr '(./"\n")[]|"    "+.' <<< $'Code\nMore code'
    Code
    More code

On-line test
jq, 13 characters
(8 characters code + 5 characters command line options)
If we can rely on the interpreter's line oriented processing mode.
"    "+.

bash-4.3$ jq -Rr '"    "+.' <<< $'Code\nMore code'
    Code
    More code
On-line test

Common Lisp, 65 61 bytes
-4 thanks to Julian
(loop for l =(read-line t nil)while l do(format t"~4t~A~%"l))

Reads from *standard-input* (stdin, by default) and writes four spaces followed by each line to *standard-output* (stdout, by default).
Ungolfed
(loop :for l := (read-line t nil) :while l :do (format t"~4t~A~%" l))

Explanation
(read-line t nil)
Read a line from *standard-input* (shorthanded to t), not raising an error on EOF (the EOF return value is optional and defaults to nil). The line is returned as a string without the trialing "\n".
(format t "~4t~A~%" l)
Prints out formatted text to *standard-output* (shorthanded to t).
"~4t~A~%" is a formatting string. ~4t moves to the fourth column (prints 4 spaces), ~A prints out an argument to format, ~% prints out a newline.
(loop :for l := ... :while l :do ...)
Each time through the loop, assign l to the result of reading in a line of text, break the loop if there was no line to read, and print out the line with four spaces prepended.

Many implementations would not require the leading colons for loop keywords, which could save you a few bites.

You know, I'm well aware of that, and yet I keep forgetting it when I do code golf...

I think I just really want to forget that that's even a thing.

C#, 46 35 bytes
s=>"    "+s.Replace("\n","\n    ");

REXX, 41 bytes
do while lines()>0
say '    'linein()
end

Reads from stdin, writes to stdout.

Charcoal, 6 bytes
ＰＳＭ⁴←

Try it online!
Note:
There is a space at the end
Explanation
ＰＳ     Print next input as string
   Ｍ⁴←  Move 4 cells left
         (it's a space) Print space

Err, including the space, that's 16 bytes in UTF-8.

Yeah, but Charcoal doesn't use UTF-8

The accepted V answer's first solution is 6 UTF-8 bytes (but 4 V-bytes), so it was counted as such until they introduced a 4-byte UTF-8 solution.

@Papayaman1000 ... the current V answer isn't in UTF-8

read more of it.

@Papayaman1000 That's just pretty much a bonus answer, it doesn't have to be in UTF-8 at all

ok, fair enough.

@Papayaman1000 Yeah, a lot of esolangs here use custom codepages e.g. Actually/Jelly/V/Charcoal

@Papayaman1000 Yeah, as ASCII-only said, the 4 byte UTF-8 V answer was just a bonus. But the V answer is enocded in Latin1, not UTF-8, where it is 4 bytes despite being 6 bytes in UTF-8. For reference, you can see Charcoal's Code Page here: https://github.com/somebody1234/Charcoal/wiki/Code-page

Carrot, 22 bytes, non-competing
Non-competing because of a bug with the website not showing leading whitespace in the output that was fixed recently
    #^//^.*/gmS"
    "

(note the leading spaces on each of the lines)
Try it online here.
Explanation
First we are in caret mode, where every character gets pushed to the stack (which is just a string). The four leading spaces on the first line push these spaces to the stack. Then the # pushes all of the input to the stack. Now the first line has four leading spaces. And the ^ takes us out of caret mode.
Next comes the / operator. The function of each operator depends on the argument it takes. In this case, the operator takes in a regex as its argument. The / operator with a regex argument returns the matches of the regex.  The regex is /^.*/gm, this matches every line in the stack (except for the newlines). Now the stack turns from being a string into an array that contains the matches.
The S operator with a string argument joins the elements of the stack array with the argument. So in this case, we are joining the matches with this string, \n    .
To simplify what was done here, the program prepends 4 spaces to the input and then substitutes newlines with a newline and 4 spaces (I really need to add a substitution operator to Carrot).

Tcl, 40
Now as a function:
proc p t {regsub -all -line ^ $t "    "}

demo
Did not save bytes after all!

Cubix, 28 bytes
v.@>i??soS4.^(s<.....u!-Ns<v

Try it online!
Net form:
      v . @
      > i ?
      ? s o
S 4 . ^ ( s < . . . . .
u ! - N s < v . . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Explanation coming soon...

Mathematica, 34 bytes
(Needs version 10.)
StringReplace[StartOfLine->"    "]

Explanation: A string replacement operator where the start of each line is turned into "    ".

Tcl, 40
puts [regsub -all ^ [read stdin] "    "]

demo — Notes:

Avoid to press backspace key, it will execute the browser's History back.
To end the input press Ctrl+D after you had input all lines (you may have to press two times has it tends to get absorbed has a browser keybinding). If you paste the on a Windows interpreter, use Ctrl+Z+Enter to mark end of input.
Pressing arrow keys will make appear strange chars instead of moving cursor.
Yes, online interpreters really suck
The rest of code is only for input and output, does not really process the string

Are... are you familiar with bash? Because some of those "issues" sound like any normal CLI. Furthermore, I have no issues with keybinds or anything (maybe your browser just sucks?). Finally, in/out is a necessary part of this program, as per the rules; include it in the snippet and the byte count.

I didn't touch a real Linux/Unix shell for years but you made me recall where such come from; they are not happening on my local Windows machine. May be the browser (Vivaldi) is absorbing keybindings when it should not. Updated to include output and input part; updated also the link to the new script demo. I think I can reduce the byte count to less if I make a function instead of user I/O.

BTW, the Mathematica answer also seems to not have IO part

Thunno 2 N, 7 bytes
¶/ð4×s+

Try it online!
Explanation
¶/ð4×s+  # Implicit input
¶/       # Split on newlines
  ð4×    # Push four spaces
     s+  # Prepend it to each
         # Join on newlines
         # Implicit output


text:
"Monitorize" an Image
The Problem:
This challenge comes from a real problem I was having. I have a dual monitor setup at work, and I wanted to use the following image as my wallpaper:

However, my monitors have quite significant bezels, and when I set my background, it looks something like this, where the pier appears (appiers?) to be broken:

I was able to solve this by making an image with the center cut out of it, and then stretching it back to the original size, as in the image below:

The Challenge:
Write a program that takes in an image and "monitorizes" it  for use with a dual monitor setup (i.e. deletes the center section of the image, where the bezels are). The rules are as follows:

It must be a full program that accepts the image, either as a path (string argument, etc), or in the form of a file chooser dialog.
The program must take as an input the number of vertical lines (one pixel in width) to crop out from the center of the image
The cropping must come from the center (width-wise) of the original image
The resultant image must be re-scaled back to the original size of the input image. (Either the halves can be scaled individually, and then concatenated, or concatenated and then scaled. Scaling individually produces a better image/effect, but is hardly noticeable in the real world)
Background images are generally even, so to make this challenge easier, input images will only have an even number of pixels, and number of lines to remove will only be even as well.
This challenge is code golf - shortest code in bytes wins

Good Luck!

It's not very clear from the pictures what the operation is, because they're scaled to the same width. Perhaps replace the first and last one with images that are the same size as the middle one and padded with white? 2. Can we use any form of rescaling (linear is probably cheapest) or does it have to be a specific one (e.g. cubic, sinc, etc.)?

@PeterTaylor As per rule 3, the input and output images are supposed to be the same width. Either each half is resized to half the original width, and then concatenated, or the cropped halves are concatenated, then scaled back to the original size. And yes, any scaling is fine.

The sentence beginning "Perhaps" was a suggestion for how to make the question easier to understand, not a suggested interpretation of the challenge. I've made the change myself.

@PeterTaylor Ahh, i see, That makes it clearer. Thanks.

Can we assume that the image will be landscape oriented?

@ScottMilner Yes

-1 bad puns (just kidding, I upvoted :P Nice challenge!)

Octave, 85 bytes
@(f,n)imsave(imresize((o=imread(f))(:,[1:(end-n)/2,(end+n)/2:end],:),size(o)(1:2)),f)

Defines an anonymous function with f the file name, and n the number of columns to remove. Since an anonymous function requires a single expression, inline assignment is used, a feature not present in MATLAB.
MATLAB, 98 bytes
As a bonus, I also golfed a MATLAB compatible answer. Interestingly, this is only 13 bytes longer, since the Octave version needs a lot of parentheses to correctly parse the inline assignments.
function  m(f,n)
o=imread(f);imsave(imresize(o(:,[1:(end-n)/2,(end+n)/2:end],:),size(o(:,:,1))),f)

Matlab 2013, 150 bytes
Here is my attempt in Matlab. Definitely won't be the shortest code, but it's a start.
Warning, this overwrites the original image, so make a copy first.
Golfed Version
function  mi(f,n)
o=imread(f);
s=size(o);
imwrite([imresize(o(:,1:((s(2)-n)/2),:),[s(1),s(2)/2]) imresize(o(:,((s(2)+n)/2):end,:),[s(1),s(2)/2])], f);
end

Ungolfed Code, with improvements for odd image sizes and odd number of columns
function  monitorizeImage( filename, num_columns )

orig = imread(filename);
orig_size = size(orig);

f = factor(orig_size(2));
origsize_iseven = f(1)==2;

f = factor(num_columns);
num_columns_iseven = f(1)==2;

odd_even_size_mismatch = xor(origsize_iseven,num_columns_iseven);

img_resized = imresize(orig,[orig_size(1) orig_size(2)+odd_even_size_mismatch]);

leftimg = img_resized(:,1:((orig_size(2)+odd_even_size_mismatch-num_columns)/2),:);
leftimg = imresize(leftimg,[orig_size(1),floor(orig_size(2)/2)]);
rightimg = img_resized(:,((orig_size(2)-odd_even_size_mismatch+num_columns)/2):end,:);
rightimg = imresize(rightimg,[orig_size(1),floor(orig_size(2)/2)]);

monitorized_image = [leftimg rightimg];
monitorized_image = imresize(monitorized_image,[orig_size(1),orig_size(2)+ ~origsize_iseven]);

[~, ~, ext] = fileparts(filename);

imwrite(monitorized_image,strcat(filename(1:end-length(ext)),'_',num2str(num_columns),ext));

end

Just adding to this: answers to challenges must make a serious attempt at optimising for the given scoring criterion. In a [tag:code-golf] challenge like this one, that means that any obvious improvements that would reduce the length of the code must be made.

Try removing unused spaces and whitespace.

@ais523 Thanks. Down to 220 bytes!

Also, every two-byte variable is one too many. Readability is not important, so refactor os etc. to any other letter in the alphabet! And why not just write the image back to to the input image f to save the whole strcat? (which, incidentally, you can replace by ['',...] rather than strcat(...))

@Sanchises Thanks, that was a leftover from the ungolfed/improved version. Nothing in the rules stated it couldn't overwrite, or needed to have pretty named outputs. Thanks...that decreased byte count by 70 bytes!

See my new answer if you would like some more inspiration on how to golf in MATLAB.

Wolfram Language, 134, 127, 119 111 bytes
f[i_,c_]:=(d=ImageDimensions@i;ImageAssemble[ImageTake[i,a=All,#]&/@{{0,e=-#&@@d/2-c/2},{-e,a}}]~ImageResize~d)

Creates a function f that takes an image as the first input (as a symbol in Mathematica or the Wolfram Cloud), and an integer as the second input.
Ungolfed:
f[image_,columns_]:=(  (*Define Function*)
    d=ImageDimensions[image];  (*Get image dimensions*)
    e=d[[1]]/2+columns/2;  (*Add half the image width to half the number of removed columns*)
    ImageResize[ImageAssemble[Map[ImageTake[i,All,#]&,{{0,-e},{e,All}}]],d]  (*Map the function onto a list with the desired column ranges and merge and scale the resulting image*)
)

Technically, it won't work properly if either of the image dimensions exceed 362,880 pixels, but I assume that's okay, since that is way outside the scope of the problem (and some computers). Fixed!

PHP, 206 bytes
($c=imagecopyresized)($t=imagecreatetruecolor($w=imagesx($s=imagecreatefrompng($argv[1])),$h=imagesy($s)),$s,0,0,0,0,$v=$w/2,$h,$x=$v-$argv[2]/2,$h);$c($t,$s,$v,0,$w-$x,0,$v,$h,$x,$h);imagepng($t,$argv[3]);

takes three command line arguments: source file name, number of lines to crop and target filename.
Run with -r.
You may want to use imagecopyresampled instead of imagecopyresized (+2 bytes) for a better result.
ungolfed
$s=imagecreatefrompng($argv[1]);    # load source image
$w=imagesx($s);$h=imagesy($s);      # get image dimensions
$t=imagecreatetruecolor($w,$h);     # create target image
$v=$w/2;                            # $v = half width
$x=$v-$argv[2]/2;                   # $x = width of remaining halves
                                    # resize and copy halves:
imagecopyresized($t,$s, 0,0,    0,0,$v,$h,$x,$h);
imagecopyresized($t,$s,$v,0,$w-$x,0,$v,$h,$x,$h);
imagepng($t,$argv[3]);              # save target image

I could save 9 more bytes by sending the PNG result to STDOUT ... but what for?

"I could save 9 more bytes by sending the PNG result to STDOUT ... but what for?" Then you could run something like php -r image.php image.png 1 > output.png, right?


text:
Smooth as Teflon
Literally! April 6th is National Teflon Day, which is celebrated with Teflon-coated pans (what we will be making). So, given a positive integer n, create a Teflon pan. The "pan" section of the pan is an octagon with each of its sides consisting of n characters, which will vary depending on which side it is except for the sides using the character { or }. Those sides will have a character length of one always. If n is 1:
  _
 / \
{   }
 \_/

As you can see, each side consists of one character (either {, }, /, \, or _). If n is 2:
   __
  /  \
 /    \
{      }
 \    /
  \__/

The handle will be created with n+3 ='s and end with a zero (0).

If n is one:
  _
 / \
{   }====0
 \_/

n is 2:
   __
  /  \
 /    \
{      }=====0
 \    /
  \__/

n is 3:
    ___
   /   \
  /     \
 /       \
{         }======0
 \       /
  \     /
   \___/

If n is 4:
     ____
    /    \
   /      \
  /        \
 /          \
{            }=======0
 \          /
  \        /
   \      /
    \____/

Rules and Criterion

No loopholes allowed
Handle comes out the right hand side (the side made of the } character)
Input is a positive integer
If the side does not consist of either { or } (not the left or right side), they will consist of n respective characters:
            _
           / \
Left side {   } Right side
           \_/

Since this is code-golf, shortest code wins!

Could you please add more test cases?

@xnor Added two more

The test cases for n=3 and n=4 don't have the right number of characters on the top or bottom edges

@fəˈnɛtɪk Thanks! That has been fixed

Can I take O instead of 0 for the knob?

Teflon is nearly as smooth as a shark... https://twitter.com/bransonreese/status/848746940179382272

@Titus No you may not

Charcoal,  41   38   36   30  28 bytes
Thanks to @Emigna for helping to save two bytes, thanks to @ASCII-only for saving six bytes, and thanks to @Neil for saving another two bytes!
Ｎη↙η↑←×_η↖η↗{↗η×_η↓↘η}×=⁺³η0

Try it online!
Explanation:
Ｎη                 // Take the size of the pan as input.
↙η                 // Draw a line of η '\'s going down to the left.
↑←×_η              // Move one step up and print η underscores to the left.
↖η↗{↗η             // Print a line of η '\'s going up to the left.
                   // Then move one step north-east and print '{'.
                   // Then print a line of η '/'s going up to the right.
×_η↓               // Print '_' η times and move one step down.
↘η}                // Draw a line of η '\'s going down to the right, then print '}'.
×=⁺³η              // Print '=' η+3 times.
0                  // Print '0'

You can move left of the starting point in Charcoal can't you? If so, starting at the tip of the handle should save a few bytes by not having to backtrack already printed space.

@Emigna Thanks, I didn't know that. I had never used Charcoal before.

@Steadybox 30 bytes: Ｎη↖ηＧ←η_↙↙η{↓↘ηＭ↑×η_↗η}×⁺³η=Ｐ0

28 bytes: Ｎη↙η↑←×_η↖η↗{↗η×_η↓↘η}×=⁺³η0 (1 byte saved by printing the bottom half of the pan first making the Ｍ unnecessary and 1 byte saved by reversing the parameters to × making the Ｐ unnecessary.)

JavaScript (ES6), 171 bytes

f=
n=>(r=s=>s[0][0].repeat(n-1)+s)`  `+r`_
`+r` `.replace(/ /g," $'/$' $`$`$`\\\n")+`{`+r` `+r` `+r` }`+r`====0`+r` `.replace(/ /g,"\n $`\\$` $'$'$'/").replace(/ +\/$/,r`_/`)
<input type=number min=1 oninput=o.textContent=f(this.value)>

The whole pizza pan is very repetitious so the r function (designed as a tagged template literal) repeats the first character of its input n times. This handles the top and middle and lines of the pan. The rest is repeated by replacing a string of blanks; the $` and $' subsitutions automatically correspond to increasing and decreasing numbers of blanks thus positioning the / and \ appropriately. Finally the _s are filled in on the last line as it's subtly different from the second line in that respect.

JavaScript + HTML, 575 bytes (451 bytes only JS) 376 bytes (482 bytes only JS)

y=document,y.y=y.getElementById,a=(b,c)=>{w="";for(z=0;z{n=Number(y.y("n").value);s="";u=" ";j="
",m="\\",o="/";for(i=-2;i<=2*n;i++)-2==i?s+=a(n+1,u)+a(n,"_")+j:i<n-1?s+=a(n-i-1,u)+o+a(2*(i+1)+n,u)+m+j:i==n-1?s+="{"+a(3*n,u)+"}"+a(n+3,"=")+"0"+j:i+1==2*n?s+=a(n,u)+m+a(n,"_")+o:i+1<2*n&&(s+=a(i-n+1,u)+m+a(5*n-2*i-2,u)+o+j);y.y("p").innerHTML=s};
<input type="number" id='n'><button onclick='d()'>Do</button>

Not a complicated approach: several string concatenations using conditions for the five different parts of the pan: the uppermost, lowermost and middle lines and the upper and lower halves.
I shortened as much as I could, but it was the limit with this method.
EDIT: it wasn't - additionally golfed by @programmer5000

Great first answer! Welcome to Programming Puzzles and Code Golf!

Was it great? I mean, it took much more time to make than it should have been and is not even really short - but thanks anyway!

You should visit the question on golfing tips for Javascript

Didn't know there are tips too - thanks!

Welcome to PPCG. For me any answer that shows some effort and a serious attempt to meet the challenge is a good answer and deserves an upvote. Good luck with the hints and tips. My first tip would be, stop thinking like the kind of programmer that you would want to work on a project with and start doing all of the things that you hate when you take over someone elses code (one letter variables, shortcut if statements, etc.) :)

Python 3, 196 bytes
n=int(input())
p=print
s=' '
def m(i,f,b,c=s):p(s*(n-i)+f+c*(n+2*i)+b)
p(s*n+s+'_'*n)
for i in range(n):m(i,*'/\\')
p('{'+s*n*3+'}'+'='*(n+3)+'0')
for i in range(n-1,0,-1):m(i,*'\\/')
m(0,*'\\/_')

I used a few variables to shorten the code, but it's mostly straightforward. Here's a longer, more readable version:
n = int(input())

def middle_part(i, first_slash, second_slash, middle_char=' '):
    print(' ' * (n-i) + first_slash + middle_char * (n + 2*i) + second_slash)

print(' ' * (n+1) + '_' * n)

for i in range(n):
    middle_part(i, '/', '\\')

print('{' + ' ' * n*3 + '}' + '=' * (n+3) + '0')

for i in range(n-1, 0, -1):
    middle_part(i, '\\', '/')

middle_part(0, '\\', '/', middle_char='_')

Edit: changed to read n from stdin, 181 → 196 bytes

PHP, 174 bytes
echo($p=str_pad)("",-$i=-1-$n=$argn),$p(_,$n,_);for(;$i++<$n;)echo$p("
",1+$a=abs($i)),$i?$p("\/"[$i<0],1+$n*3-$a*2,"_ "[$i<$n])."\/"[$i>0]:$p("{",$n*3).$p("} ",5+$n,"="). 0;

Takes input from STDIN; run with -nR or test it online.
breakdown
// first line
echo($p=str_pad)("",-$i=-1-$n=$argn),$p(_,$n,_);
// loop $i from -$n to $n
for(;$i++<$n;)echo
    $p("\n",1+$a=abs($i)),                  // 1. left padding
$i?                     // if not middle line:
    $p("\/"[$i<0],1+$n*3-$a*2,"_ "[$i<$n])  // 2. left edge and inner padding
    ."\/"[$i>0]                             // 3. right edge
:                       // else:
    $p("{",$n*3)                            // 2. left edge and inner padding
    .$p(" }",5+$n,"=")                      // 3. right edge
    . 0                                     // 4. knob
;

Python 2.7, 194 195 191 187 185 bytes
n=input();s=' ';a='\\';z='/'
def m(f,b,i,c=s):print(n-i)*s+f+c*(n+2*i)+b
m(s,s,0,'_')
for i in range(n):m(z,a,i)
print'{'+s*n*3+'}'+'='*(n+3)+'0';exec"m(a,z,i);i-=1;"*(n-1);m(a,z,0,'_')

Try it online!
Open to edit suggestions to make it smaller. :)
Edit 1: +1 byte - Credits to ElPedro for pointing out an error in the code, which made it 1 byte longer.
Edit 2: -4 bytes - Credits to piyush-ravi for removing unneccesary arguments.
Edit 3: -4 bytes - How did I not see that? :P
Edit 4: -2 bytes - Replacing '\n' with ';'

It looks looks the first line below the middle line should not be there when I try it locally. tried it for input 4 and 3 and it looks wrong. Won't retract the upvote until you have had time to review and explain or fix though. My fault for not looking hard enough :)

Thanks for pointing it out ElPedro. Fixed it :)

Python 2, 180 178 bytes
s,i=' ',input();R=range(i)
print'\n'.join([s+s*i+'_'*i]+[s*(i-a)+'/'+s*(i+a*2)+'\\'for a in R]+['{'+s*i*3+'}'+'='*(i+3)+'0']+[s*(i-c)+'\\'+'_ '[c>0]*(i+c*2)+'/'for c in R[::-1]])

Try it online!

PowerShell, 165 bytes
param($n)($a=' '*$n)+" "+($b='_'*$n);$n..1|%{' '*$_+"/"+' '*($n+2*$i++)+"\"};"{$($a*3)}$('='*($n+3))0";if($n-1){1..($n-1)|%{' '*$_+"\"+' '*($n+2*--$i)+"/"}};"$a\$b/"

Try it online!
Takes input $n, sets $a to a bunch of spaces, $b to a bunch of underscores, and string concatenates that with a space. That's left on the pipeline.
Loops from $n down to 1. If $n=1, this will only execute once. Each iteration we do a string concatenation of spaces, a /, more spaces with counter $i, and a \. Those are all left on the pipeline.
Then comes the middle part with the handle, which coincidentally has $a*3 spaces in the middle, and $n+3 = signs, then a 0. That's left on the pipeline.
If $n is bigger than 1, then $n-1 is truthy so we enter the conditional, where we loop the other direction to form the bottom of the pan. If $n=1, then we don't need this portion due to how the lines work. Those are all left on the pipeline. We finish off with the spaces and underlines with the $a\$b/ bottom of the pan.
All those strings from the pipeline are sent via implicit Write-Output that prints them with newlines in between elements.

JavaScript + HTML - 346 bytes
JavaScript - 314 bytes, HTML - 32 bytes

function o(a){a=parseInt(a),String.prototype.r=String.prototype.repeat;c=console.log,d=" ".r(a),e="_".r(a);c(" "+d+e);for(f=a-1,g=a;f>=0;f--,g+=2)c(" ".r(f+1)+"/"+" ".r(g)+"\\");c("{ }=0".replace(" "," ".r(3*a)).replace("=","=".r(a)));for(f=0,g=3*a;f<a-1;f++,g-=2)c(" ".r(f+1)+"\\"+" ".r(g-2)+"/");c(d+"\\"+e+"/")}
<input id=n onkeyup=o(n.value)>

Un-golfed

function o(sides) {

  String.prototype.r = String.prototype.repeat;
  var middle = '{ }=0',
  log = console.log,
  ss = ' '.r(sides),
  u = '_'.r(sides),
  sides = parseInt(sides);

  // top
  log(' ' + ss + u);

  // top mid
  for (var i = sides - 1, j = sides; i >= 0; i--, j += 2) {
    log(' '.r(i + 1) + '/' + ' '.r(j) + '\\');
  }

  // mid
  log('{ }=0'.replace(' ', ' '.r(sides * 3)).replace('=', '='.r(sides)));

  // bottom mid
  for (var i = 0, j = sides * 3; i < sides - 1; i++, j -= 2) {
    log(' '.r(i + 1) + '\\' + ' '.r(j - 2) + '/');
  }

  // bottom
  log(ss + '\\' + u + '/');

}
<input id="n" onkeyup="o(n.value)">

C, 249 bytes
o(c,a){for(;a--;)putchar(c);}s;p(n){o(32,n+1);o(95,n);o(10,1);for(s=0;s<n;s++)o(32,n-s),o(47,1),o(32,n+s*2),o(92,1),o(10,1);o(123,1);o(32,n*3);o(125,1);o(61,3+n);o(48,1);o(10,1);for(s=n-1;s>-1;s--)o(32,n-s),o(92,1),o(s?32:95,n+s*2),o(47,1),o(10,1);}

Try it online

212 bytes

Vyxal, 69 bytes
›\_?*꘍,(nε\/꘍₴nd⁰+\\꘍,)\{₴3*\}꘍₴3+\=*0+,(n›\\꘍₴nε‹d+n›⁰=` _`$i$*₴\/,)

Try it Online!
Unfortunate bytecount...


text:
How can I golf this code to count all perfect squares below 100?
I'm trying to strip down my python code to be as few lines as possible. The task: count how many square numbers are below 100. Here's my code so far:
m = 0
for x in range(0, 100):
    m+=1-(-((-((x+1)**(0.5)-((x+1)**(0.5))//1))//1));
print(m)

That addition statement adds 1 to m (the counter) only when (x+1) is a perfect square. Is it possible to shorten anything? Maybe find a way to print without using a counter -- such as printing a summation in a form such as:
print(sum(min,max,variable,statement))

print(9) works :P

To close voters: [tips] are on topic.

I mean, you can get rid of the semicolon on your third line.

You say you want to count how many square numbers are below 100, but you're counting how many are between 1 and 100 inclusive. Which is it?

Have you taken a look at out Python golf tips? In particular, there's some easy gains from removing whitespace and parentheses. I think asking for particular advice for this particular golf is putting the cart before the horse.

You could quite easily do print(int(100**0.5))...

@Riker, "That addition statement adds 1 to m (the counter) only when (x+1) is a perfect square."

@Ben oh, didnt see that. Sorry.

For the exact question posed: since we know that 1 is a perfect square and all integers between that and the maximal one (here 9) will be included we can simply find that maximal one:
print((100-1)**.5//1)

(//1 performing integer division by one to remove any fractional part may be replaced with /1 prior to Python 3.)
with both endpoints (an inclusive start and exclusive stop equivalent to a range) this could be extended to a function (negative inputs catered for with max):
f=lambda start, stop:print(max(0,stop-1)**.5//1-max(0,start)**.5//1)

Ah, that's a good bit of math to solve the problem. Well done.

For the record, below is another approach using additions and multiplications only.
The square of N is the sum of the N first odd positive integers:
1^2 = 1
2^2 = 1 + 3 = 4
3^2 = 1 + 3 + 5 = 9
4^2 = 1 + 3 + 5 + 7 = 16
etc.

Consequently, if we are to compute all perfect squares up to a given limit, each one can be quickly deduced from the previous one.
Hence the following possible algorithms:
# with 3 variables, using addition only
s = i = 1
n = 0

while s < 100:
  n += 1
  i += 2
  s += i

print(n)

# with 2 variables, using addition and multiplication
s = 1
n = 0

while s < 100:
  n += 1
  s += n * 2 + 1

print(n)

Or as a recursive lambda:
f = lambda x, s=0, n=0: f(x, s+n*2+1, n+1) if s < x else n-1

print(f(100))

This works (47 chars):
print(sum(map(lambda n:0==n**.5%1,range(100))))

n**.5 will return a float, which will be a whole number if n is a perfect square. We can then do %1 to get the fractional part, which will be 0 if n is a perfect square, so adding 0== will give us a boolean of whether or not n is a perfect square.
We can then make that into a lambda function and map that onto the range, which will give us a list of booleans, which can be summed to give us how many True values were there.
As in Ben Frankel's answer, it's actually shorter to use list comprehension than map. I didn't think of that. That gets us down to 41 chars.
print(sum(0==n**.5%1for n in range(100)))

EDIT: removed one byte by replacing not with 0==

How about this?
print(sum(x==int(x**.5)**2for x in range(1,101)))

This is a sum of boolean values, so they are treated as 0 for False and 1 for True.
EDIT: As in Riker's answer, x**.5%1==0 is shorter than x==int(x**.5)**2.