text:
How many lights are on?
You are little speck on a Cartesian plane. Pondering your existence, you decide to roam around your plane and touch things. You notice that every coordinate pair you visit has a light switch. To entertain yourself, you decide to toggle every switch that you come across.
The Challenge: Create a program that will take an input of random length, using only the characters v,^,<, and >. These characters correspond to movements.

< moves you one unit to the left
^ moves you one unit up
> moves you one unit to the right
v moves you one unit down

Using this randomly generated input, calculate how many switches will be left in the ON position, assuming you start at (0,0), all lights begin in the OFF state, and you don't turn on any lights until you make your first move. (Meaning, if you start at (0,0), and move up 1 unit to (0,1), there will now be 1 light on). If you come across a switch that is on the ON position, it will be turned OFF.
Test cases:
v>v<^^<v<<^<^><<>^^>>><v>vv^v>v^><><<^>><<<vvv^vvv>v>>v><vv^^<<>vv^^>v^<>>^^<^^>^^v<^>^<vvv^v^v><^<<v<<>><<>v>>^><^>^^<>>>>vv>^<<^<<><vvv<v^>>vvv>v^>>><<v^>^^^^v>>^>^v>v<vv^<>^<<v>vv>><^^<^><vv^^v<v<v^^^>v<^vv^v<><vv^^^>v^>v>vv<<^><v<^v><<v^^v>>v<vv<><^^^v<^v><><<^^<>^>><^^^>vv^<>>>>^<^<<<<>>>v<<v<v<vv><<vv<vv<^v^^^>>vv<>v>><<<v^>vv><v<<<v<<>^vvv^<v^v>^^v^v><<v^>>>v<v<v^>>>v><>>>^<><<<<>vv>v><v>v><^v<>v>>>vv<<>^>^>v<^><^<^vv^><^^>v<^^v>v^v<^^^^vv<>v<>><v^^><>v<<<>v^<v^^><>^<>^<>><>^^<>^v><>>><v<^^>>v>^^^<v

yields 125 lights on.
>>><^>>>^vv><^^v^<<<>>^<>>^<^>^<<^^v^<v^>>^<<><<>^v<^^^vv>v><^>>^<^<v><^v<^<<^^v><>>^v<^>^v<vvv<<<v^vv>>^vv>^^<>>vv>^<^>vv<>v^<^v<^^<v^^^<<^><><>^v>vvv<^vvv<vv><vv<^^v^^<^^>>><<<>^<>>><^<<<>><>^v><^^vv<>>><^^^<^>>>>v<v^><<>v<v<v^<<^><v^^><>v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<v^<>^<>v>>v<^v>v<>^^vvv<>vv^v^<><v^vv^<^v^v><>^><v^<>>^^^<>>vv^<v>^^v><v<^>^^^^^^><>>vvv<<><><v<^>v<>v^v<<<<>v^>>>>^v>^^<v^>v><v^<^^v<<<<v<<<>^v<^>^v>v^^>v^^vvv>vv<>^>v><v<>^<vv><>>><<^>>><<v>v^^<^<<<<v^<>>>v<<<^v^vv<>^v>v<<<<>^^>><v><>v<v><^^>><>^>^>v>>><v>^vvvv<><><^>>^v^><<>^v<><><^><<<>v^^>v>^>v^<v^vv<>><^vv^^>^^><vv<<>v>v^^>><v^>^<^<>>>vv<>^>v>v^<>v<^<<v>>>^<>v^>v>>vv^^<>>v<v<<^<>v>v^<^^^>v^^>v>v>vv<^<v>v^^><<<v<><>^^<>v>v>^^v>v>v^v>>^<v^v>><>^^>^<>>>^vv^><v^<^>v^>^v><^>^^^vv^^v<>vv<>>^><<^v>^v^>>v>^v^<<^^^vv<<vvv>^vv^v<<<v^^<<><vv<>>^^vv>^^^vv>><><v>v<^v^>>>vv^><>><v<^v<>^><v<^^^^>><^<>v>^v<^vv>v>v<^<>v>v>^<vv>v<^>vvv<v^<vv<vv<>v>^><v^v<>>>>>v>><^v<>v>^v><v^v^vv<>^<vvv^>><v^<vvv^^<^vvv^v^<>><v>v^^v<><>v^^^v<<<^><v<<<>><<vv<<><vvv^v>>v^v<v^>>><<v<>^v><>vv<<v>v^vv>v^v<^<vv<><><^v>^<vv>v^^>>^^^><vv<><^>>>^<v^<<^^>^>vv^><v<vvv>^^>>>^><<vv>vv>^<>>^^><^v><<>^<<<v^>^

yields 1408 lights on.
To generate input, you may use the following Python script:
import random
length = random.randint(15, 10000)
walk = ''
chars = ['v', '<', '>', '^']
for i in range(length):
    walk += random.choice(chars)
print(walk)

Standard code-golf scoring, winner is the smallest number of bytes.

4 lights are on.

No, there are five.

So... if you come across a light that is already on? Does it remain on? Edit: what i mean is, can this challenge be summarized as "the number of unique coordinates reached by the given path, starting at 0,0?"

Sorry, I should have been more clear. You toggle each switch you come across. If you come across one that is on, you turn it off. I can post a couple test cases, if you like.

Oh, people, don't be so harsh on a newcomer.

The challenge looks pretty clear (and interesting) to me. Voting to reopen

Thank you for the reopen. If nobody else answers within the next 10 minutes, I'll post my rather clunky Python solution.

Welcome to Programming Puzzles and Code Golf! :)

I don't see any harshness, just advice on what needs improving, and now the challenge is ready. Nice first challenge!

Does your script mean that the input length limit is 10000?

I edited the generator script to make it more idiomatic, feel free to roll back the edit if you want to.

I don't understand what the output should do. If I input ">>vvv<<", What output will do?

@Chad : the number of switches in the ON position, at the end. So with your input, the output will be "7".

Can you confirm if functions are allowed or if our submissions must be complete programs?

MATL, 19 18 17 13 bytes
5 bytes off thanks to @LeakyNun's idea (see his answer) of using the imaginary unit as a base for exponentiation.
Jj11\^Ys8#uos

Try it online! Test cases: 1, 2.
Explanation
The code traces the path using unit steps in the complex plane. Then it counts how many times each position was visited, and outputs how many positions were visited an odd number of times.
J         % Push the imaginary unit, 1j
j         % Input string
11\       % Modulo 11. This gives 7 6 5 8 for > ^ < v
^         % 1j raised to those numbers, element-wise. This gives -1j for >, -1 for ^,
          % 1j for < and 1 for v. So it gives the displacements in a "transposed"
          % complex plane
Ys        % Cumulative sum. This transforms displacements into positions
8#u       % Count of occurrences of each unique position
o         % 1 if odd, 0 if even
s         % Sum. Implicitly display

This looks curious

If you mean the spacing, yes, it's ugly. On Matlab it does look better: 0+1i   0-1i  -1+0i   1+0i

No, that was golfing you 3 bytes

@LeakyNun Yes, I just realized :-) 13 bytes now!

Why use i instead of j?

@LeakyNun Actually either can be used here. j avoids the enclosing quotes, because it considers the input as an unevaluated string

But you did change from j to i

@LeakyNun Because I got confused. When you have something like 11j, the parser interprets that as the number 11j. So you'd need 11 j, or 11i to avoid that. But in this case it's j11, which works fine. So I went back to j

Python, 68 bytes
25 bytes thanks to Sp3000.
2 bytes thanks to Luis Mendo's idea of taking modulus with 11.
17 bytes thanks to xnor.
d=set()
p=0
for c in input():p+=1j**(ord(c)%11);d^={p}
print(len(d))

Ideone it!

It's shorter to use a set doing d^={p} and len(d).

Java 8, 169 130 127 bytes
Thanks to Leaky Nun for saving 29 32 bytes.
s->{int l=s.length,d=2*l+1,p=l*d+d,r=0,m[]=new int[d*d];for(char c:s){p+=c<61?-1:c<63?1:c<95?-l:l;m[p]^=2;r+=m[p]-1;}return r;}

Ungolfed (sorta):
public static int f(char[] s) {
    int l = s.length, d = 2*l+1, p=l*d+d, r = 0;
    int[] m = new int[d*d];
    for(char c : s) {
        p += c<61 ? -1 : c<63 ? 1 : c<95 ? -l : l;
        m[p] ^= 2;
        r += m[p] - 1;
    }
    return r;
}

for(char c:s){p+=c<61?-1:c<63?1:c<95?-l:l;m[p]^=2;r+=m[p]-1;} can be for(int c:s)r+=(m[p+=c<61?-1:c<63?1:c<95?-l:l]^=2)-1; to save 8 bytes: Try it online.

Jelly, 13 bytes
A port of Luis Mendo's answer in MATL
O%11*@ı+\œ^/L

Try it online!
O%11*@ı+\œ^/L
O             convert to codepoint
 %11          modulo 11
    *@ı       power of i (imaginary unit)
       +\     cumulative sum
         œ^/  reduce by multiset symmetric difference
            L length

Credits of the œ^/ trick to Dennis

Perl, 49 bytes
Includes +1 for -p
Run with the control string on STDIN
./lights.pl <<< "<<>"

lights.pl:
#!/usr/bin/perl -p
$\-=1-($a{$x+=/</-/>/,$y+=/\^/-/v/}^=2)for/./g}{

If input is restricted to 10000 bytes this reduces to 44+1:
$\+=$#{$x+=/</-/>/.e5+/\^/-/v/}*=-1for/./g}{

TSQL, 238 235 203 191 bytes
Creating a table in memory using recursive SQL. Selecting and calculating from that table(one line code).
Golfed:
DECLARE @ varchar(max)= 'v>v<';

WITH C as(SELECT 0 a,b=1UNION ALL SELECT
a+POWER(CHARINDEX(SUBSTRING(@,b,1),'> <v')-2,15),b+1FROM
C WHERE b<=LEN(@))SELECT top
1sum(sum(1-1/b)%2)over()FROM c
GROUP BY a OPTION(MAXRECURSION 0)

Ungolfed:
DECLARE @ varchar(max)= '>>>><^v^v';

WITH C as
(
  SELECT 0 a,b=1
  UNION ALL
  SELECT a+POWER(CHARINDEX(SUBSTRING(@,b,1),'> <v')-2,15),b+1
  FROM C
  WHERE b<=LEN(@)
)
SELECT top 1sum(sum(1-1/b)%2)over()
FROM c
GROUP BY a
OPTION(MAXRECURSION 0)

Fiddle

Mathematica, 64 bytes
A port of Luis Mendo's MATL answer.
Count[{_,_?OddQ}]@Tally@Accumulate[I^Mod[ToCharacterCode@#,11]]&

62 bytes by using infix notation

SQF, 160 bytes
Using the function-as-a-file format:
x=0;y=0;a=[];{switch(_x){case"v":{y=y-1};case"^":{y=y+1};case"<":{x=x-1};case">":{x=x+1};};if([x,y]in a)then{a=a-[[x,y]]}else{a=a+[[x,y]]}}forEach _this;count a

Call as: "STRING" call NAME_OF_COMPILED_FUNCTION
Ungolfed:
//position tracker variables
x = 0; y = 0;
//`a` keeps track of which coords are switched on
a = [];
{
    //switch based on the magic variable `_x`
    //which is the current element of the forEach
    //and adjust coord tracker variables
    switch(_x) {
        case "v": {
            y = y - 1
        };
        case "^": {
            y = y + 1
        };
        case "<": {
            x = x - 1
        };
        case ">": {
            x = x + 1
        };
    };
    //check if the coord is already turned on
    if ([x, y] in a) then {
        //remove it from `a` using array exclusion
        a = a - [[x, y]]
    } else {
        //append it to `a`
        a = a + [[x, y]]
    }
//do this for each character in _this (the argument)
} forEach _this;
//return the length of `a`
count a

easily followed, but how is the performance?

@zinking That depends on how you execute it. Really fast with a static compile at engine load time, much slower with compile "CODE".

Python: 207 189 181 Bytes
a = input()
l=[]
for i in range(0,len(a)):
 if a[i]=='v':y-=1
 if a[i]=='^':y+=1
 if a[i]=='<':x-=1
 if a[i]=='>':x+=1
 if [x,y] in l:l.remove([x,y])
 else:l.append([x,y])
print(l)

Input is a string.
Thanks to @LuisMendo for pointing out that I can actually only indent by 1 space. Darn my Python teachers for telling me to always do it increments of four.
Fixing it so that input was obtained rather than assumed stored actually saved me 8 bytes.

I don't know Python, but I think 1-space indenting is enough, and it will save you a few bytes

All these years, I've been making sure to always indent at increments of 4.

But not in code golf :-)

You can't assume that the input is pre-stored. Just use input() and store it somewhere

If you ever need more than one level of nested indentation, there's a great tip about mixing spaces and tabs

@LeakyNun Fixed the code so that input was not assumed.

@CasperTheFriendlyCode You can use tabs instead of spaces, too. A tab is only one character.

As I only have one level of nesting, tabs would not save any bytes here.

Which Python? - on 2.7 you'd need to add x=y=0 before the loop.  Also shouldn't you print len(l) for the "how many" aspect?  On the other hand you can do for b in a: and then if b=='v' etc. That gets you to 165

Um... Maybe removing the whitespace around the first = and l+=[[x,y]] is also shorter then l.append([x,y]).

Ruby, 64 + 6 = 70 bytes
+6 bytes for -rset flag.
A straight port of Leaky Nun's Python answer.
->s{d=Set.new
q=0
s.each_char{|c|d^=[q+=1i**(c.ord%11)]}
d.size}

See it on repl.it: https://repl.it/Cnjy

I believe the -rset flag only counts as 4 bytes.

With the newest meta changes the -rset flag now counts as 0 bytes.

@ValueInk Oof. I don’t like that at all. Thanks for the heads-up, though.

I think they made some pretty good points as to why they want to do this (like how -e being "free" in Ruby means -n is 1 byte instead of 3 but people who don't know about that could report different bytecounts) but to each their own. BTW, Set[] saves 2 bytes over Set.new.

Another thought I had while thinking up a non-rset answer: bytes.map saves 4 bytes over each_char because you can take out the ord call.

Javascript (ES6), 97 93 85 bytes
i=>[...i].reduce((c,d)=>c-1+(v[p+=v['^<>v'.search(d)]]^=2),0,p=1E6,v=[-1E3,-1,1,1E3])

EDIT: -8 bytes, thanks to Neil
Test:

var test0 = 'v>v<^^<v<<^<^><<>^^>>><v>vv^v>v^><><<^>><<<vvv^vvv>v>>v><vv^^<<>vv^^>v^<>>^^<^^>^^v<^>^<vvv^v^v><^<<v<<>><<>v>>^><^>^^<>>>>vv>^<<^<<><vvv<v^>>vvv>v^>>><<v^>^^^^v>>^>^v>v<vv^<>^<<v>vv>><^^<^><vv^^v<v<v^^^>v<^vv^v<><vv^^^>v^>v>vv<<^><v<^v><<v^^v>>v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>^><v<^^^^>><^<>v>^v<^vv>v>v<^<>v>v>^<vv>v<^>vvv<v^<vv<vv<>v>^><v^v<>>>>>v>><^v<>v>^v><v^v^vv<>^<vvv^>><v^<vvv^^<^vvv^v^<>><v>v^^v<><>v^^^v<<<^><v<<<>><<vv<<><vvv^v>>v^v<v^>>><<v<>^v><>vv<<v>v^vv>v^v<^<vv<><><^v>^<vv>v^^>>^^^><vv<><^>>>^<v^<<^^>^>vv^><v<vvv>^^>>>^><<vv>vv>^<>>^^><^v><<>^<<<v^>^';

S=i=>[...i].reduce((c,d)=>c-1+(v[p+=v['^<>v'.search(d)]]^=2),0,p=1E6,v=[-1E3,-1,1,1E3])

console.log(S(test0))
console.log(S(test1))

Use [...i] instead of i.split(''). Also, I think you can write (p=1E6,v=[-1,1,-1E3,1E3],0) as 0,p=1E6,v=[-1,1,-1E3,1E3].

If you can arrange for the ^ to be first, search saves a byte over indexOf. (You need the ^ to be first because search treats ^ as a regexp metacharacter.)

You don't have to count the S= part.

@Arnauld No, the argument name(s) itself is/are part of the function and should remain. However, assigning the function to a variable ("S=") is optional (as you can just call the function like («function code here»)(«argument»)).

R, 172 156  137 101 96 bytes
n=function(a)sum(table(cumsum(sapply(strsplit(a,"")[[1]],switch,v=-1,"^"=1,">"=1i,"<"=-1i)))%%2)

Using @LeakyNun's complex plane idea.
ungolfed
n=function(a){
    b=strsplit(a,"")[[1]]                        #Splits String up
    p=sapply(b,switch,v=-1,"^"=1,">"=1i,"<"=-1i) #Replaces characters with directions
    q=cumsum(p)                                  #Finds each location visitied
    t=table(q)%%2                                #Determines if spots were visited an odd # of times
    sum(t)                                       #counts odd visited spots
}

Actually, 24 23 bytes
This is a port of Luis Mendo's MATL answer. Golfing suggestions welcome. Try it online!
Edit: One byte thanks to Leaky Nun.
O⌠4P@%ïⁿ⌡Mσ;╗╔⌠╜c2@%⌡MΣ

Ungolfing:
O        ord(c) of the input string (implicit input)
⌠...⌡M   Start a function, and map over the list of ord(). Call the variable i.
  4P@%     i mod 11 (the 4-th prime).
  ïⁿ       1i to the power of (i%11).

σ        Push a list of cumulative sums of the new list of complex numbers.
           This is a list of the coordinate visited.
;╗       Duplicate coord_list, and push to register 0.
╔        uniquify(coord_list)

⌠...⌡M   Map over the uniquified list. Call the variable j.
  ╜c       Push coord_list.count(j)
  2@%      Push count mod 2

Σ        Return the sum of this last list.

Other than writing :11 as 4P, I am unable to come up with any golf advice

PowerShell, 136 bytes
$a=@();switch -w($args|% t*y){'^'{$y++}'>'{$x++}'v'{$y--}'<'{$x--}*{if("$x,$y"-in$a){$a=$a|?{$_-ne"$x,$y"}}else{$a+="$x,$y"}}};$a.length

Try it online!
I think there's more to optimize here, but this is the lowest I got for now.
Easier to read:

$a=@();switch -w($args|% t*y){
    '^'{$y++}
    '>'{$x++}
    'v'{$y--}
    '<'{$x--}
    *{if("$x,$y"-in$a){$a=$a|?{$_-ne"$x,$y"}}else{$a+="$x,$y"}}
};$a.length

Explanation: The input is changed to a character array and each piece is matched to one of the first 4 switch cases to increment the x or y coord. Everything matches the 5th case where we decide if a light is turned on or off. Length at the end determines total number of switches turned on.
Note: The comma in the coordinates is necessary so we don't get collisions like (10,10) and (101,0)

Strip some apostrophes and pull $x,$y into a variable for 127bytes

-ne works with array 115 bytes

Length -> Count for 114

PowerShell, 96 95 bytes
$(switch -w($args|% t*y){^{$y++}'>'{$x++}v{$y--}'<'{$x--}*{"$x,$y"}})|group|% c*|%{$r+=$_%2}
$r

Try it online!
Unrolled:
$plane=$(switch -w($args|% toCharArray){
    ^  {$y++}
    '>'{$x++}
    v  {$y--}
    '<'{$x--}
    *  {"$x,$y"}
})
$plane|group|% count|{$result+=$_%2}
$result

PowerShell, 112 109 bytes
A port of Luis Mendo's MATL answer.
$args|% t*y|%{($p+=($c=[numerics.complex])::Pow($c::new(0,1),$_%11))}|group{'{0:N2}'-f$_}|% c*|?{$r+=$_%2};$r

Try it online!

Perl, 102 98 91 90 (89 + -n) bytes
perl -nE '$i=ord()%5,$x+=(-1..1)[$i],$y+=((0)x3,1,-1)[$i],$p{$x,$y}^=1 for/./g;say~~grep$_,values%p'

Readable:
$_ = <>; # -n
for (/./g) {
    $i = ord() % 5;
    $x += (-1 .. 1)[$i];
    $y += ((0) x 3, 1, -1)[$i];
    $p{$x, $y} ^= 1;
}

say 0 + grep $_, values %p;

thanks Dada for -4 and -7

it's the first time I see "readable" and "perl" in the same post I think!

More seriously, great answer. You can still win a few byte if you use for/./g instead of while, which allows you to use ord() instead of ord($&).

A few more things that can win a few bytes on PPCG : use say instead of print (since -M5.010 or -E are free) and use -n flag (cost 1 byte) instead of doing $_=<>.

C, 203 190 189 bytes
#define S(s)1-(*s%11<7)*2<<*s%11%2*16
char*t,*u;P,p,r,L,e;
f(char*s){for(P=L=0,t=s;*t;++t){P+=S(t);e=r=1;for(p=0,u=s;u<t;u++)e*=(p+=S(u))!=P;for(p=P;*++u;r^=p==P)p+=S(u);L+=e*r;}return L;}

O(n^2) with O(1) memory algorithm.
It loops over every position, checks if this position occurs earlier, and if not checks if this position occurs an even/odd amount of time afterwards, adding it to the total.

C# 210 205 139 138 135 128 113 Bytes
using System.Linq;int f(string s,int x=0,int y=0)=>s.GroupBy(c=>(x+=c%6%3-1)+s+(y-=c/3%6-2)).Sum(g=>g.Count()%2);

Explanation
//Have X and Y as default params allows us to use a expression bodied member
//and then remove the return statement
int f(string s, int x = 0, int y = 0) =>

    //treat the string as a char array
    s.GroupBy(c =>

            //Using the unerlying int of the char this math reduces down to either x - 1, x + 1, x + 0, y - 1 or y + 1, or y + 0
            //Concat the resulting values with the original string to ensure uniqueness ie x=1 and y=11 vs x=11 and y=1 for the grouping
            (x += c % 6 % 3 - 1) + s + (y -= c / 3 % 6 - 2))

     //Mod 2 will return either 1 or 0 so we can use sum to count the groups with odd counts
     .Sum(g => g.Count() % 2);

Thanks to VisualMelon for 5 bytes switching Count to Sum
Thanks again to VisualMelon, this time for 66 bytes by suggesting some fancy math to get the translations.
VisualMelon to the rescue again with combining the select and group by for 13 bytes and just using the input string for the x/y separator for another 2

Nice... I like this a lot. Can you not use Distinct() rather than GroupBy(z=>z)? You can also use Sum(g=>g.Count()%2), since it's always 0 or 1, I should think.

I also recon you can (sadly, I rather like it...) replace the func indexing with something like (x+=c%6%3-1)+"."+(y-=c%18/5-1) (just add a number we compute from the char with some stupid modulus and such). I've not tested, I'll let you fix it if it's broken ;) This ought to save a lot of bytes if I've not messed up! (And there is surly a cheaper pair of expressions, but these are just what I could come up with in the last 20minutes)

@VisualMelon Distinct() doesn't work (unless i'm missing something) as it returns one of each string, rather than giving me a count of the occurences.

@VisualMelon good idea with using the sum, saved 5 bytes. As for your suggestion regarding the funcs, i think i need to understand why that works (it does) before i post it. is the choosing of the numbers based on the underlying values of the chars?

Yes, don't know what I was thinking about Distinct... I'm far too used to using Group as a lazy man's distinct I suppose... Aye, the stupid expression c%6%3-1 simply maps ASCII values of <>v^ to -1,1,0,0 (change in x, note the zero values) and the other expression produces a similar result for y. There are probably better expressions (I didn't look very hard), a drop of ternary might pay off. This was my first effort, which perhaps makes it more obvious what is going on: (c<61?--x:c<63?++x:x)+"."+(c>95?--y:c>93?++y:y) (but obviously it's quite a bit longer!)

@VisualMelon thanks for the description, it does make sense now, though my math skills are nowhere near good enough to golf those expressions down without just pure brute force. :)

@VisualMelon Managed to reduce the y expression by a character, it does flip the y directions but it still produces the correct count.

This is very cool - it was even cool @VisualMelon's awesome improvements, so kudos to both of you. But (and sorry to be a wet blanket), the question asks for a program, and this isn't a complete program. I haven't been around here for a while so forgive me if I've missed some consensus on what's acceptable for C# submissions. I just feel that to be fair to each other we have to have a level playing field (among submissions of the same language of course). Not that I plan to compete with this (I was going to, but after VisuaMelon's input I can't better it).

@IgbyLargeman While i am still quite new here it has been my experience that functions and even lambdas are generally accepted unless called out specifically. I have left a comment on the question asking the OP to clarify, I will of course modify my answer if they only want complete programs.

@IgbyLargeman if you've got any suggetions for improvement, do share them! We C#ers need to put on as best a show as possible, and any opportunity we have to beat Java is a good opportunity. Yes, as much I prefer to always post complete programs, functions are generally accepted. Even none-static functions are usually accepted, so I doubt anyone is going to question the ethics of this post, especially when the Java question is just a lambda expression, it's not even named ;)

Just realised we can save 2 bytes by replace +"."+ with +s+ since it's non-numerical; might use a tad more memory though ;) Also,  I've not tested this, but can we not simply have the GroupBy on the c=>... expression, and forget the select? s.GroupBy(c=>(x+=.....

@VisualMelon nice catch on both of those. And also for reminding me to remove the static, noticed it last night, missed it while copying it from my test project into np++ for byte counting.

K (oK), 37 29 27 bytes
Solution:
+/2!.#:'=+\-99 0 99 -1 1@5!

Try it online!
Explanation:
Create list of steps, create path, group, count each repeat, if mod 2 is 0 then off, else on. Felt very AdventOfCode-ish.
+/2!.#:'=+\-99 0 99 -1 1@5! / the solution
                        5!  / input mod 5, "^v<>" yields 4 3 0 2
           -99 0 99 -1 1    / left, null, right, down, up
         +\                 / sum along
        =                   / group into key=>value
     #:'                    / count each value
    .                       / take the value
  2!                        / modulo 2
+/                          / sum up

Notes:

-8 bytes by stealing David Horák's method of squashing x-y into x (I know it has limitations, but it works for the examples)
-2 bytes thanks to ngn

1 -1 -99 99"^v<>"? -> -99 0 99 -1 1@5!

+/2!.#:' -> +/~=/'^

First comment works for -2, second one throws an error... what are you trying to do with the ^?

my mistake. i wanted to use it as "is null?" on the dict's values (to make them all 0s) but apparently oK doesn't work that way :(

Yeah, sadly it uses ^ as 'except' rather than null :(

except is dyadic, null is monadic. oK does have null but it's buggy and doesn't penetrate in dictionary values

Perl 6, 47 bytes
{sum bag([\+] (-i,*i...*)[.ords X%11]){*}X%2}

Try it online!

(-i, *i, ... *) is the infinite repeating sequence -i, 1, i, -1, ...
[.ords X% 11] slices into that sequence with the ordinal values of the characters in the input string, modulo 11.
[\+] performs a triangular reduction (or "scan") on those values, producing a list of the coordinates visited on the complex plane.
bag() creates a Bag containing those coordinates, each of which has an associated multiplicity (the number of times it appeared in the list).
{*} fetches all of the multiplicities from the bag.
X% 2 crosses those multiplicities with the number 2 using the modulus operator %.  Odd multiplicities result in a 1, even multiplicities result in a 0.
sum sums those remainders.

Common Lisp, 198 bytes 186 bytes
Solution:
(let((p 0)(c 0)(h(make-hash-table)))(progn(loop for s across i do(incf(gethash(incf p(nth(position s "^>v<")'(1e3 1 -1e3 -1)))h 0)))(maphash #'(lambda(k v)(incf c(mod v 2)))h)(write c)))

Run it!
Explanation:
(let ((p 0)(c 0)(h (make-hash-table)))
  (progn
    (loop for s across i
      do(incf (gethash (incf p (nth (position s "^>v<")'(1e3 1 -1e3 -1))) h 0)))
    (maphash #'(lambda (k v) (incf c (mod v 2))) h)
    (write c)))

p is a hashtable map key, generated as an index of the character within the string "^>v<", remapped to values 1000, -1000, 1 -1 representing the x,y. (x axis is +-1, y axis is +-1000)
the hash value at that index is incremented by 1 (switch counter)
the hashtable is than looped trough, and the map function increment the final count as modulo 2 of the value on a given key

Note: i (input) is defined it test as:
(defparameter i ">>><^>>>^vv><^^v^<<<>>^<>>^<^>^<<^^v^<v^>>^<<><<>^v<^^^vv>v><^>>^<^<v><^v<^<<^^v><>>^v<^>^v<vvv<<<v^vv>>^vv>^^<>>vv>^<^>vv<>v^<^v<^^<v^^^<<^><><>^v>vvv<^vvv<vv><vv<^^v^^<^^>>><<<>^<>>><^<<<>><>^v><^^vv<>>><^^^<^>>>>v<v^><<>v<v<v^<<^><v^^><>v>^<>^^^vvv<v^>^^^^v>v<v>>>v^^<v<vv>><<>^vv><<vv<<>^^v>>v<^^v>><v<v<<>^^vv>>^v>v>v<>^>^v<>>><>v>v<<v<^<>>>vv>>v>^<>vv^v><><^v^>v<^^>v<^v>>v^>^>>v>v>^>^<^^>vv>>^vv<^><>^><<v^<><<^<^>^^vv^<<^^<^^v<v<>^>v>>>>>>vv<<v>^>vv^>^><^<^^><<vvvv>vvv<><<><v^vv><v^^<>^>><^vv<><>^>vv>>>vv^vv<<^v^^<<v^^>^>vvv<><<v>^>^>v<v>^<^^^^<^>^>><>>^^vv<>v<^>v><v<v^>>v<^v<vv>v^>v<v^<^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^<>v^>v>>vv^^<>>v<v<<^<>v>v^<^^^>v^^>v>v>vv<^<v>v^^><<<v<><>^^<>v>v>^^v>v>v^v>>^<v^v>><>^^>^<>>>^vv^><v^<^>v^>^v><^>^^^vv^^v<>vv<>>^><<^v>^v^>>v>^v^<<^^^vv<<vvv>^vv^v<<<v^^<<><vv<>>^^vv>^^^vv>><><v>v<^v^>>>vv^><>><v<^v<>^><v<^^^^>><^<>v>^v<^vv>v>v<^<>v>v>^<vv>v<^>vvv<v^<vv<vv<>v>^><v^v<>>>>>v>><^v<>v>^v><v^v^vv<>^<vvv^>><v^<vvv^^<^vvv^v^<>><v>v^^v<><>v^^^v<<<^><v<<<>><<vv<<><vvv^v>>v^v<v^>>><<v<>^v><>vv<<v>v^vv>v^v<^<vv<><><^v>^<vv>v^^>>^^^><vv<><^>>>^<v^<<^^>^>vv^><v<vvv>^^>>>^><<vv>vv>^<>>^^><^v><<>^<<<v^>^")

Does this mean that going up 1 is the equivalent of going right 1000 times - and you could clash? I like the idea of compressing x/y into a single dimension though so I'm going to nab it :) PS - you can use (99 1 -99 -1) to shave 2 bytes..

@streetster correct, that's the idea. To compress the x/y into 1d, where y must have some buffer to not interfere with the x. (and yes it might actually clash - therefore bigger gab, smaller the chance - thus I am using actually 1000 (1e3), so 999 would be the same byte length).

APL (Dyalog Unicode), 21 20 bytesSBCS
+/≠/×⊢⌸+\0j1*'^<v'⍳⎕

Try it online!
uses ⎕io←1
⎕ input
'^<v'⍳ find the index of each input char among '^<v', i.e. ^ becomes 1, < 2, v 3, and anything else 4
0j1* i to the power (the imaginary constant)
+\ partials sums
⊢⌸ matrix in which each row is the list of occurrences (indices) of a unique partial sum; padded with 0s to make it rectangular
× signum - all indices become 1s, the padding remains 0s
≠/ sum mod 2 for each row
+/ sum

krrp, 137 bytes
^>:\L\T[length],^v>xy:!tTxy!V?[elem]tv[without]vLtELtv?#?E>V!c#!f>?=c$62.@V#!r>+x1y?=c$60.@V#!r>-x1y?=c$94.@V#!r>x-y1@V#!r>x+y1.LT00E>00.

Try it online!

Explanation
^>:\L\T                ~ lambda expression, import list and tuple module
 [length],^v>xy:       ~  the answer is the number of lattice points
                       ~  which were visited an odd number of times
  !tTxy                ~   current lattice point
  !V ?[elem]tv         ~   if the lattice point is already present,
      [without]vLtE    ~    remove it, else
      Ltv              ~    add it
  ?#?E> V              ~   no further moves
  !c#!f>               ~   move character
  ?=c$62. @V#!r>+x1y   ~   move right
   ?=c$60. @V#!r>-x1y  ~    move left
    ?=c$94. @V#!r>x-y1 ~     move up
     @V#!r>x+y1        ~      move down
 .LT00E>00.            ~ initialize at point (0, 0)

Try it online!
Unfortunately, krrp only has one rather slow implementation, making the long test cases difficult to verify.
krrp String conversion.

Ruby, 67 bytes
Inspired by orlp's C solution. Assembles a list of all visited positions, and then for each unique one (using setwise intersection (d&d) since it saves a byte over d.uniq), count the ones with an odd number of occurrences (technically, map it to the occurances%2, and sum them together, since that does the same thing)
->s,q=0{d=s.bytes.map{|c|q+=1i**(c%11)}
(d&d).sum{|c|d.count(c)%2}}

Try it online!


text:
Alphabet to Number and Number to Alphabet
Challenge
In this challenge you have to take a number as input and output the corresponding letter of the alphabet, and vice versa. (1 <=> A, 2 <=> B) etc.
1 -> A
2 -> B
...
26 -> Z

A -> 1
B -> 2
...
Z -> 26

Rules

This is code-golf, so shortest code in bytes wins.
The input will only consist of either an uppercase letter from A to Z or an integer from 1 to 26 inclusive.
Trailing whitespaces (space and newline) are allowed.

"You can't create variable, just arrays, let and const." "100 -> 0" Is it ok now?

@Chad Can you just let invalid input be undefined? i.e. it can error or do anything? Basicially it can be assumed the input is valid.

If I have a statically typed language, can I input the numbers as a string?

Why duplicate? O.o It is not equal.

@NathanMerrill Yes, of course.

Welcome to Programming Puzzles and Code Golf! This challenge could use a bit of clarification. For example, you could specify what inputs we would need to handle, since there are invalid inputs. I recommend posting future challenges to the Sandbox where they can get meaningful feedback before being posted to the main site.

I'm still not clear on what the valid inputs and outputs are.

Will we receive 26 as an integer or "26" as a string, or are both allowed?

Are we allowed leading newline?

Does it have to be uppercase, or is lowercase acceptable instead?

Seriously, another alphabet challenge? ( ͡° ͜ʖ ͡°)

@shooqie Why I can't?

Who will do a program with less of 7 Bytes,will exceed the current winner.

Is the output of number-to-letter conversion required to be uppercase as well?

Related.

Actually, 7 bytes
ú' +ûEí

Try it online!
Explanation:
ú' +ûEí
ú' +     lowercase English alphabet, prepend space
    û    uppercase
     E   element (pushes the nth letter if input is an integer, leaves stack alone otherwise)
      í  index (pushes index of input if input is a string, leaves stack alone otherwise)

If lowercase is acceptable, this is 6 bytes:
ú' +Eí

Try it online!

You're winning at the moment, I think nobody could do a program with less 7 bytes.

@Chad There easily could be a solution under 7 bytes.

I joined just to ask this. @Mego what language is this?

@FoldedChromatin looks like https://github.com/Mego/Seriously

@FoldedChromatin Actually, it's Actually. Hence Actually, 7 bytes. :P

Moments like these make me happy about the names I chose for my languages :)

I just realized Actually is the in-place successor to Seriously. I assumed the latter was someone else's project which inspired yours. The GitHub URL makes it all the more clear?/confusing?

@Dan The confusing names are intentional. Seriously is both the name of the project and the name of the first version. Actually is the name of Seriously v2. Seriously v3 will have a separate name, as well as being Actually v2.

@Mego Lmao. The rolling versions, multiple names scheme is hysterical.

Pure Bash, 51
Most of the rest of the answers use some sort of conditional.  This one dispenses with conditionals entirely, and instead treats the input as a base-36 number which indexes into an appropriately constructed bash-brace-expansion array:
a=(_ {A..I} {1..26} {J..Z} {A..Z})
echo ${a[36#$1]}

Ideone.

So what does the # do?

@R.Kap "numbers take the form [base#]n, where the optional base is a decimal number".

Erlang, 26 bytes
f([X])->X-64;f(X)->[X+64].

One of the few times where Erlang's string behavior is useful.

Python 2, 38 bytes
lambda x:x>''and 64^ord(x)or chr(64^x)

Test it on Ideone.

Python 3, 43 bytes
lambda x:x!=str(x)and chr(64|x)or ord(x)^64

The interesting thing about this solution is that it incorporates all the senses of OR, bitwise OR |, logical OR or, bitwise XOR ^ and logical XOR != ...

2sable, 9 8 bytes
Code:
.bAu¹kr,

Explanation:
.b        # Convert 1 -> A, 2 -> B, etc.
  A       # Push the alphabet.
   u      # Convert it to uppercase.
    ¹k    # Find the index of the letter in the alphabet.
      r   # Reverse the stack.
       ,  # Pop and print with a newline.

Uses the CP-1252 encoding. Try it online!.

Can't you delete ,? Which bytes are without ,? You don't need to print a new line.

@Chad Nope, that won't work for numeric inputs :(

Ruby, 47 39 + n flag = 40 bytes 33 34 31 bytes
Anonymous function. Uses an exception handling trick like in @KarlNapf's Python solution.
-3 bytes from @manatwork
Try it online
->i{(64+i).chr rescue i.ord-64}

Original full program version with the n flag for 40 bytes and reads from STDIN:
puts$_!~/\d/?$_.ord-64:(64+$_.to_i).chr

I'm getting syntax error when trying to run on ideone, can you tell how to test?

@Leibrug oops! It's fixed now

You can reduce it more by shamelessly applying Karl Napf's trick from his Python solution: ->i{(64+i).chr rescue i.ord-64}.

Cheddar, 34 32 bytes
Saved 2 bytes thanks to @LeakyNun
n->"%s"%n==n?n.ord()-64:@"(n+64)

I wish there was shorter way to check if string or number.
Try it online! or
Test Suite
Explanation
n ->                // func with arg `n`
    "%s"%n==n ?     // if n is string... (see below)
       n.ord() - 64  // return code point - 64
    :               // else...
    @"(n+64)         // chr(n+64)

"%s"%n==n checks if it is a string in a simple way. "%s" is a string format, I can format with % e.g. "a %s c" % "b" is equal to "a b c". %s specifies it is a string, if a digit is passed it'll remain as %s.

"%s"%n==n saves 2 bytes

@LeakyNun oh that's smart! I was tryomg of doing "%d"%n==n but that wasn't working :/

Mathematica 54 41 Bytes
With an absolutely clever suggestion from LegionMammal978 that saves 13 bytes.
If[#>0,FromLetterNumber,,LetterNumber]@#&

If[#>0,FromLetterNumber,,LetterNumber] serves the sole purpose of deciding whether to apply FromLetterNumber or LetterNumber to the input.
#>0 will be satisfied if the input, #, is a number, in which case FromLetterNumberwill be selected.
However #>0 will be neither true nor false if # is a letter, and LetterNumber will be selected instead.

If[#>0,FromLetterNumber,,LetterNumber]@#&["d"]

4

If[#>0,FromLetterNumber,,LetterNumber]@#&[4]

d

In Mathematica, FromLetterNumber and LetterNumber will also work with other alphabets.  This requires only a few more bytes.
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[4, "Greek"]
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[4, "Russian"]
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[4, "Romanian"]

δ
г
b
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[δ, "Greek"]
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[г, "Russian"]
If[# > 0, FromLetterNumber, , LetterNumber][#, #2] &[b, "Romanian"]

4
4
4

Some golfing, bringing it to 41 bytes: If[#>0,FromLetterNumber,,LetterNumber]@#&

I interpret your suggestion as: If[#>0,FromLetterNumber[#],LetterNumber@#]&.  Although If[#>0,FromLetterNumber[#],LetterNumber@#]&[4] works, If[#>0,FromLetterNumber[#],LetterNumber@#]&["c"] does not. It apparently cannot resolve "c">0. Did I misunderstand?

The double ,, is intentional, and so is the exterior @#; it evaluates as If[# > 0, FromLetterNumber, Null, LetterNumber][#]&, which uses the 4-argument form of If (look it up).

Amazing how the 4-argument form of If works.

Haskell, 54 bytes
f s|s<"A"=[['@'..]!!read s]|1<2=show$fromEnum(s!!0)-64

Usage example: map f ["1","26","A","Z"] -> ["A","Z","1","26"].
Haskell's strict type system is a real pain here. Additionally all the short char <-> int functions like chr and ord need an import, so I have to do it by hand. For the letter -> int case, for example I need to convert String -> Char (via !!0) -> Integer (via fromEnum) -> String (via show).

C, 55 bytes
i;f(char*s){i=atol(s);printf(i?"%c":"%d",64^(i?i:*s));}

Perl 6, 25 bytes
{+$_??chr $_+64!!.ord-64}

Explanation:
# bare block lambda with implicit parameter of ｢$_｣
{
    +$_         # is the input numeric
  ??
    chr $_ + 64 # if it is add 64 and get the character
  !!
    $_.ord - 64 # otherwise get the ordinal and subtract 64
}

Example:
say ('A'..'Z').map: {+$_??chr $_+64!!.ord-64}
# (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26)

say (1..26).map: {+$_??chr $_+64!!.ord-64}
# (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)

Even though the syntax is so different, that same mechanism is the same number of bytes in Perl 5: perl -pe '$_=/\d/?chr$_+64:-64+ord'!

C#, 32 bytes
n=>(n^=64)>26?(object)(char)n:n;

Casts to Func<int, object>.
Input: char implicitely converts to int so can be called with int (1-26) or char ('A'-Z').
Output: Either a char or int.

PHP, 49 41 40 bytes
<?=+($i=$argv[1])?chr($i+64):ord($i)-64;

I do not think there is a good alternative to is_numeric right?
This is executed from command line ($argv[1] is the first variable given)
Thanks to:
@insertusernamehere: Golfed 8 bytes. Replacing is_numeric($i=$argv[1]) with 0<($i=$argv[1]).This works because (int)"randomLetter" == 0.
@manatwork: Reduced with 1 byte. Replace 0< with +. What happens in this case is that the + signal will cast the "Z" (or whatever letter) to an 0. This will result in false. Therefor any letter is always false and a number is always true.

Using 0<($i=$argv[1]) instead of is_numeric($i=$argv[1]) saves you 8 bytes.

Continuing on that idea: 0< → +.

Excel, 33 bytes
=IFERROR(CHAR(A1+64),CODE(A1)-64)

Python 2, 61 bytes
i=raw_input()
try:o=chr(int(i)+64)
except:o=ord(i)-64
print o

Yes I could switch to Python 3 for input

Use input() nevertheless and change int(i) to i.

Then character inputs don't work.

Take input as "A"

That's lame. A or nothing.

You could knock a few bytes off by reformulating it as a function: line 1: def f(i):, line 2:  try:o=chr(i+64), line 3  otherwise unchanged, line 4:  return o  In that form, it would work in either Python 2 or Python 3

Brainfuck, 445 Characters
More a proof of concept than a golfed code.
Requires Unsigned, Non-wrapping Brainfuck.
,[>+>+<<-]>[<+>-]>>++[->++++++<]>[-<<<+++++>>>]<<<<[->-<]>[,<++++[->------------<]++++[->>------------<<][-<<++++++++++>>]>[-<+>]>[-<<++++++++++>>]>++[->++++++<]>+[-<+++++>]<-[-<<<+>>>]<<<.>]>[[-<+<+>>]>++[->++++++<]>+[-<+++++>]<-[-<<->>]<<[->+>+<<]>>>++++++++++<+[>[->+>+<<]>[-<<-[>]>>>[<[-<->]<[>]>>[[-]>>+<]>-<]<<]>>>+<<[-<<+>>]<<<]>>>>>[-<<<<<+>>>>>]<<<<<-[->+>+<<]>[-<++++++++++>]<[-<->]++++[-<++++++++++++>]++++[->>++++++++++++<<]>>.<<<.>]

With Comments
,[>+>+<<-] Firstly Duplicate it across two buffers
>[<+>-] Move the second buffer back to the first buffer
>>++[->++++++<]>[-<<<+++++>>>] Establish 60 in the second buffer
<<<<
Compare Buffers 1 and 2
[->-<]
>
[ If there's still data in buffer 2
, Write the value in the units column to buffer two
<
++++
[->------------<] Subtract 12 from the units buffer
++++
[->>------------<<] Subtract 12 from the tens buffer
[-<<++++++++++>>] Multiply buffer three by ten into buffer 1
>
[-<+>] Add the units
>
[-<<++++++++++>>] Add the tens
>++ Add 65 to the buffer
[->++++++<]>+
[-<+++++>]
<- Actually we need 64 because A is 1
[-<<<+>>>] Add 64 to the first buffer
<<<
. Print the new letter
> Move to blank buffer
]
>
[ Otherwise we're a letter
[-<+<+>>] Copy it back over the first two buffers
>++ Write 64 to the buffer
[->++++++<]>+
[-<+++++>]
<-
[-<<->>] Subtract 64 from the letter
<<[->+>+<<]
>>>++++++++++< Copy pasted Division step x = current buffer y = 10 rest of the buffers are conveniently blank

+
[>[->+>+<<]>[-<<-[>]>>>[<[-<->]<[>]>>[[-]>>+<]>-<]<<]>>>+<<[-<<+>>]<<<]>>>>>[-<<<<<+>>>>>]<<<<<
-
[->+>+<<]
>[-<++++++++++>]
<[-<->]
++++
[-<++++++++++++>]
++++
[->>++++++++++++<<]
>>.<<<.>
]

Java, 104 98 97 83 54 53 51 50 30 bytes
x->(x^=64)>64?(char)x+"":x+"";
Test Program:
IntFunction<String> f = x -> (x ^= 64) > 64 ? (char) x + "" : x + "";
out.println(f.apply('A')); // 1
out.println(f.apply('Z')); // 26
out.println((f.apply(1))); // A
out.println((f.apply(26))); //Z

You can drop about 20 bytes by using a ternary operator like so: return(s.matches("\\d+")?(char)(Integer.parseInt(s)+64)+"":(s.charAt(0)-64)+"");

you can remove casting to int as well, which allows you yo reduce by 7 bytes.

The program does not take any input. The program does not give any output. There even is no program!

@NicolasBarbulesco You are not required to write a full program unless stated otherwise.

Befunge 93, 144 90 66 54  36 19 bytes
Not 100% sure if this is allowed, but if you are allowed to type A as 65, B as 66, etc., then (for [my] convenience's sake):
&:"@"`"@"\#. #-_+,@

Otherwise, at 36 bytes:
~:0\"A"-`#v_88*-.@
**~28*++,@>68*-52

(Thanks to tngreene for the suggestions!)

~:0\567+*-`#v_88*-.>$28*+,@
52**\28*++,@>~:0`!#^_\68*-

(Thanks to Sp3000 for saving 12 bytes by rearranging!)
~:0\567+*-`#v_88*-.>$82*+,@
            >~:0`!#^_\68*-52**\28*++,@

v                   >$28*+,@
             >~:0`!#^_\68*-52**\28*++,@
>~:0\567+*-`#^_88*-.@

v                    >$28*+,@
~           >11g~:0`!|
1                    >\68*-52**\28*++,@
1
p
>011g567+*-`|
            >11g88*-.@

Ungolfed:
v                       >$ 28* + , @
                 >~:0 `!|
                        >\ 68* - 52* * \ 28* + + , @
>~:0\ 5 67+ * - `|
                 >88* - . @

This is my first working Befunge program ever, and I feel the need to golf this further. Any help would be greatly appreciated.
You can test Befunge code here.

Passing quick glance comment: Befunge wraps around, so you can move the last 12 chars of the second line to the front and get 52**\28*++,@>~:0\!#^_\68*-`

@Sp3000, oh I did't notice that. Thanks!

Congratulations on your first program ever! One thing to consider would be to generate large numbers by pushing ASCII values in a string. Compare 567+* to "A". Also, don't forget about g and p instructions for reusing a value instead of having to build it up repeatedly.
Also, I couldn't find any input that would take the IP to the branch >$ 28* + , @. What is this for? Are you sure its needed?

Lastly, I admire your dedication to parsing "26" or "08". Your method, as I read it, involves much symbol<->number conversion math, as in ('2' to 2 back to '2'). Having your first and second inputs as numbers before you start comparing them could decrease the amount of ASCII-arithmetic you're doing. Alternatively, maybe there is a way to efficiently deal with inputs as symbols ('2' as in '2'), no conversion to numbers needed!

@tngreene, Integer inputs <10 go to the branch $28*+,@ whereas  those >=10 go to the other one. This was done ultimately because you cannot read over the input more than once as far as I know.

I tried running it, and even putting in "09" it still went to the same branch as "10", golfed and un-golfed.

@tngreene, yeah because I assumed (falsely?) that 09 is invalid input and must be 9

@Dopapp Welp, if you want to remove that branch, I'd think you'd be well within the problem spec.

@tngreene, wow, that saved almost 20 bytes!

Let us continue this discussion in chat.

PowerShell v2+, 42 bytes
param($n)([char](64+$n),(+$n-64))[$n-ge65]

Takes input $n (as an integer or an explicit char) and uses a pseudo-ternary to choose between two elements of an array. The conditional is $n-ge65 (i.e., is the input ASCII A or greater). If so, we simply cast the input as an int and subtract 64. Otherwise, we add 64 to the input integer, and cast it as a [char]. In either case, the result is left on the pipeline and printing is implicit.
Examples
PS C:\Tools\Scripts\golfing> ([char[]](65..90)|%{.\alphabet-to-number.ps1 $_})-join','
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26

PS C:\Tools\Scripts\golfing> (1..26|%{.\alphabet-to-number.ps1 $_})-join','
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

Befunge-98*, 19 bytes
&:39*\`'@\j;+,@;-.@

Because the question said you'll receive a 1-26 or an A-Z I assumed this meant the number 26 or the character A-Z. Most interprets struggle with entering alt-codes, so it is easier to use & and enter values like 26 for 26 or 90 for 'Z', as opposed to ~.
Pseudo-code
int c = get stdin
push the value of 27
bool is_number =  27 > c
push the value of `@` (64)
if is_number == 1
   jump to adding 64 to c //putting it the ASCII range
   print as ASCII
   end
else
   jump to subtracting 64 from c //putting it in the numerical range
   print as number
   end

Test it out (on Windows) here!
*This is technically Unefunge-98 because it only uses 1 dimension, but that name might be unfamiliar.

Japt, 11 10 bytes
¤?UdI:InUc

Try it
¤?UdI:InUc     :Implicit input of integer or string U
¤              :Convert to binary string if integer (always truthy)
¤              :Slice off first 2 character if string (always falsey)
 ?             :If truthy
  Ud           :  Get character at codepoint U
    I          :  After first adding 64
     :         :Else
      In       :  Subtract 64 from
        Uc     :  Codepoint of U

Forth (gforth), 67 bytes
: f 2dup s>number? if d>s 64 + emit else 2drop d>s c@ 64 - . then ;

Try it online!
Input is passed as a string to the function
Code Explanation
: f             \ start a new word definition
  2dup          \ make a copy of the input string
  s>number?     \ attempt to convert to a number in base 10
  if            \ check if successful
    d>s         \ drop a number (don't need double-precision)
    64 + emit   \ add to 64 and output the ascii letter at that value
  else          \ if not successful (input was a letter)
    2drop d>s   \ get rid of garbage number conversion result and string-length
    c@ 64 - .   \ get ascii value of char, subtract 64 and output
  then          \ end the if block
;               \ end the word definition

Jelly, 7 bytes
i@ịe?ØA

Try it online!
How it works
i@ịe?ØA - Main link. Takes an input A on the left
     ØA - Set the right argument to "ABC...XYZ"
    ?   - If statement:
   e    -   Condition: left in right; is A in the alphabet?
i@      -   If so: return the 1-index of A in the alphabet
  ị     -   Else: yield the A'th element of the alphabet

><> (Fish), 27 24 21 19 bytes
<o+v?)0-}:"@":
n-$<

Try it with a number test case
Try it with a letter test case
Takes input on the stack, which is a default input method for stack-based languages, and outputs with error.

Happy to see others use my interpreter

q, 29 bytes
{@[1+.Q.A?;x;{.Q.A y-1}[;x]]}

Find the index at which our letter occurs in the built-in list of uppercase letters
If it errors, index into the same list with the input instead
Adding and taking away ones as q indexing starts at 0, not 1

Welcome to Code Golf!

And nice first answer!

Fourier, 30 bytes
I~F<64{1}{F+64a}F>64{1}{F-64o}

Try it online!

Python 3, 49 48 53 50 bytes
Somehow I got the byte count wrong ;_;
thanks dahuglenny
isalpha is shorter than isnumeric
lambda x:x.isalpha()and ord(x)-64or chr(int(x)+64)

takes input as string, which could be a letter or number

You can remove the space between x.isnumeric() and else to save one byte.

JavaScript (ES6), 49 bytes
s=>s>0?String.fromCharCode(s|64):parseInt(s,36)-9

Accepts integers in either number or string format, always return integers as a number. 42 bytes if I can return lower case and don't need to handle integers in string format:
s=>s>0?(s+9).toString(36):parseInt(s,36)-9

R, 73 bytes
f=function(x){L=LETTERS;if(is.numeric(x)){i=L[(x)]}else{i=which(L==x)};i}

No need for f=, and you cloud try to use the ifelse function to maybe golf out some bytes !

Javascript 86 77 66 60 bytes
i=>typeof i<'s'?String.fromCharCode(i+64):i.charCodeAt(0)-64

saved 7 bytes after comments about using arrow functions
saved another 11 bytes by removing return / brackets  as noted by @manatwork
saved another 6 bytes thanks to @manatwork

Use arrow functions

@BaldBantha cheers, changed it :-)

No need for return statement: i=>typeof i=='number'?String.fromCharCode(i+64):i.charCodeAt(0)-64.

@manatwork Cheers!

According to task description the typeof input can be only "number" or "string". So no need to check for =='number', <'s' will also do it.

@manatwork that's a neat trick, thanks :)

x=>-x?(9+x).toString(36):parseInt(x,36)-9, 41 bytes

@user2428118 might be worth posting that as an answer ;-)

@Dylan Done. ☺

MATL, 10 bytes
6WZ~t42>?c

Explanation:
6W              % 2**6 = 64, but golfier looking
  Z~            % bit-wise XOR with input
    t42>?       % if result is greater than 42
         c      % convert it to a character
                % else, don't

Try it online! with numeric inputs.
Try it online! with alphabetic inputs.

ASM: 10 bytes
3C 40 77 04 2C 40 EB 02 04 40

Explanation:
This is the assembled representation of a program that does exactly what is asked. It is not fully functional, because it needs some directives, but if it is added to the code segment of an assembly program it should work. It receives the input in the AL register, and if its a letter it subtracts 40h from the ASCII code value, leaving just the number(i.e B=42h, 42h-40h=2h). If the input is a number it does the opposite procedure by adding 40h. It leaves the result in the AL register. Below is the assembly source code
cmp al,40h
ja letter_to_number
sub al,40h
jmp continue
letter_to_number: add ax,40h
continue:

Also,  if you convert all the other answers to machine code, I am positive that mine would be the smallest.

I think there are a few issues: 77 02 2C should be 77 **04** 2C; the sub and add are backwards.

I applied the above corrections and created a "function" that you can call from a C program on an x86_64 machine. #define F(x) ((int(*)(int))"\x89\xf8\x3c\x40\x76\4\x2c\x40\xeb\2\4\x40\xc3")(x)

What type of assembly is this?

Turbo Assembler

Java, 61 bytes
int f(char c){return c^64;}char f(int i){return(char)(i^64);}

Ungolf'd:
int f(char c) {
    return c^64;
}

char f(int i) {
    return (char) (i^64);
}

Calling f('A') invokes the first function, retuning an int 1;  calling f(1) invokes the second function, returning the char "A".

 you have to take a number as input and output the corresponding letter of the alphabet, and vice versa. (1 <=> A, 2 <=> B) etc. I don't think a set of functions qualifies for this.

@SeanBean it's a function overload.

That takes no input. That gives no output. There is no program!

You should assume the input is either "A".."Z" or "0".."9". Since a string is the only primitive that can hold either (you don't know what the input it going to be) your function should expect a string argument.

Brachylog, 10 bytes
;.L∧Ṇi₁pL∧

Try it online!
The core of this is only 4 bytes, but the I/O for that version is a bit less than sane.

05AB1E (legacy), 9 bytes
di.bëÇ64-

Try it online or verify all test cases.
Also works in the new version of 05AB1E instead of the legacy, but the Ç wraps in a list: Try it online or verify all test cases.
Explanation:
di      # Legacy 05AB1E version: If the (implicit) input is an integer:
        # New 05AB1E version: If the (implicit) input is a positive (>= 0) integer:
  .b    #  Builtin to convert the integer to its 1-based uppercase alphabetic letter
 ë      # Else:
  Ç     #  Get the codepoint of the uppercase letter
   64-  #  And subtract 64 to convert it to its 1-based index
        # (after which the result is output implicitly)

Vyxal, 12 4 bytes
øAɾt

Try it Online!

-8 thanks to @lyxal

Explanation
Of course there's a built-in
øAɾt # Implicit input
øA   # Letter to number or number to letter
  ɾ  # Range or uppercase (overloaded)
   t # Last item

Old:
‹kA:?c[?ḟ›|i  # Implicit input
‹             # Decrement (no effect on strings)
 kA:          # Push uppercase alphabet and duplicate
    ?c        # Is the input alphabetic?
      [       # If it is:
       ?ḟ     #  Find the 0-based index of the input in the alphabet
         ›    #  And increment it to make it 1-based
          |   # Otherwise:
           i  #  Index input-1 into the alphabet

Try it Online! for 4 bytes

@lyxal nice, thanks

Lua, 76 53 50 bytes
x=...y=x:byte()print(64<y and y-64or x.char(x+64))

Try it online!
Explanation
x=... -- unpack command line arguments into x
y=x:byte()
print(
64<y -- if the first byte of the string > 64:
and y-64 -- print the first byte-64
or x.char(x+64) -- else, print chr(x+64)
)

Julia 1.0, 22 bytes
~a=a-'@'
~n::Int=n+'@'

Try it online!
This solution involves a single function with 2 methods.

R, 75 bytes
f=function(l,a=which(LETTERS==l))ifelse(length(a),a,LETTERS[as.numeric(l)])

This function technically has two inputs. But the second one is merely there because by setting a through a default, I can get rid of 2 bytes. Give the function a quoted letter or number, or just a number, and it will return the opposite.
Explanation: a tests if it is a letter and which one it is. If it isn't it pulls the relevant letter.

Python 2, 45 44 bytes
Code:
lambda x:chr(x+64)if`x`[0]>"("else ord(x)-64

q, 44 bytes
Reads from stdin
{$[0N~i:"J"$x;1+.Q.A?x 0;.Q.A i-1]}[read0 0]

JavaScript, 41 bytes
x=>-x?(9+x).toString(36):parseInt(x,36)-9

Actually I just noticed this answer is wrong. The input will be uppercase, it doesn't work then

@Dylan Fixed at the expense of three bytes.

Nice, but it doesn't give upper-case output yet. Not sure if that is also required though ;-) Nice answer though (y)

This is almost the same as my alternative answer, except for your -x golf.

Pyth, 13 bytes
.xC+64sQhxr1G

Test suite.

Gema, 53 characters
<K>=@sub{@char-int{$0};64}
<D>=@int-char{@add{$0;64}}

Sample run:
bash-4.3$ gema '<K>=@sub{@char-int{$0};64};<D>=@int-char{@add{$0;64}}' <<< 'M'
13

bash-4.3$ gema '<K>=@sub{@char-int{$0};64};<D>=@int-char{@add{$0;64}}' <<< '13'
M

This is the language every german hates

Uhm… Why? Google Translate gives no hint.

https://en.wikipedia.org/wiki/GEMA_(German_organization)

Oh, I see. Probably mr. David N. Gray was not aware of this when created his macro language.

R, 62 Bytes
f=function(x)ifelse(is.finite(x),LETTERS[x],which(LETTERS==x))

Takes the input x and checks if it is finite, which is one byte shorter than checking if it is numeric and equivalent in this case. If yes, output the letter, if no, output the position in the alphabet equal to the character input.

Do you need ==1? is.finite returns logical

match(x,LETTERS) is 3 bytes shorter

Dyalog APL, 14 bytes
{0::⎕A⍳⍵
⍵⊃⎕A}

0:: if any error happens:
 ⎕A⍳⍵ return the index of the argument in the alphabet
⍵⊃⎕A use the argument to pick an element from the alphabet (errors if the argument is character)
TryAPL online!

SQF, 72 bytes
Using the function-as-a-file format:
i=_this;if((str i)==i)then{toString[i+64]}else{((toArray i)select 0)-64}

Call as: ARG call NAME_OF_COMPILED_FUNCTION

Racket 58 bytes
(if(char? i)(-(char->integer i)64)(integer->char(+ 64 i)))

Ungolfed:
(define (f i)
  (if (char? i)
      (-(char->integer i) 64)
      (integer->char (+ 64 i))))

Testing:
(f 1)
(f 3)
(f #\A)
(f #\D)

Output:
#\A
#\C
1
4

DASH, 33 bytes
@[="num"type#0?fc +64#0?-(tc#0)64

Woo-hoo, first PPCG answer in my new functional programming language!
Installation and other info is all on the Github.
Usage
(@[="num"type#0?fc +64#0?-(tc#0)64])"A"  #. strings
(@[="num"type#0?fc +64#0?-(tc#0)64])26   #. numbers

Explanation
@                      #. lambda
  [                    #. start of conditional block
    = "num" (type #0)  #. check if argument is a number
      ? fc (+ 64 #0)   #. if so, add 64 to argument and convert from charcode
      ? - (tc #0) 64   #. otherwise, convert argument to charcode and subtract 64
                       #. we can actually leave off the closing bracket for now

tcl, 68
Not a champion by any measure, but I had to do it.
puts [expr {[string is di $a]?[format %c [incr a 64]]:[scan $a %c]}]

demo

q/kdb+, 28 26 bytes
Solution:
{((?;@) -7=(@)x)[`,.Q.A]x}

Examples:
q){((?;@) -7=(@)x)[`,.Q.A]x}1
"A"
q){((?;@) -7=(@)x)[`,.Q.A]x}2
"B"
q){((?;@) -7=(@)x)[`,.Q.A]x}26
"Z"
q){((?;@) -7=(@)x)[`,.Q.A]x}"A"
1
q){((?;@) -7=(@)x)[`,.Q.A]x}"B"
2
q){((?;@) -7=(@)x)[`,.Q.A]x}"Z"
26

Explanation:
Check the type of the input, if it's a long (-7h) then use the apply @ operator to index into the alphabet .Q.A, otherwise use ? to lookup the input in the alphabet. Note that we add null to the start of the alphabet to fake the 1-indexing:
{((?;@) -7h=type x)[`,.Q.A;x]} / ungolfed solution
{                            } / lambda function
                   [      ; ]  / apply a function to this
                    `,.Q.A     / join ` (null) to the string "ABC...XYZ"
                           x   / implicit input (e.g. "A" or 13)
 (                )            / do all this together
        -7h=type x             / is the type of parameter x a long (-7)
  (?;@)                        / ? (lookup) if true, @ (index) if false

Notes:

-2 bytes by using indexing instead of switch statement.

C++ (gcc), 27 bytes
As unnamed generic lambda, accepting char or int and returning via reference parameter (input=output)
[](auto&r){r+=r<64?64:-64;}

Try it online!

Commodore BASIC (C64/128/TheC64, VIC-20, PET) - 90 48 (tokenized) bytes
 0inputa$:ifval(a$)>0then?chr$(64+val(a$)):end
 1?asc(a$)-64

Explanation and screen shot later.

MathGolf, 13 bytes
▄l!╧¿É$♦-É♦+$

Try it online.
Explanation:
 l         # Push the input as string
  !        # Convert it to lowercase
    ¿      # If
▄          #    the lowercase alphabet
   ╧       #                           contains this value:
     É     #  Execute the following three operations:
      $    #   Convert the (implicit) input to its unicode value
       ♦-  #   Subtract 64
           # (Implicit else:)
     É     #  Execute the following three operations:
      ♦+   #   Add 64
        $  #   And convert it to the character with this unicode value
           # (after which the entire stack joined together is output implicitly)

Haskell, 63 62 bytes
This uses the rule that wrapping the output in an optional type is allowed. We just use the standard lookup function to search in a list of tuples that define the input/output relationship.
(`lookup`zip(c++n)(n++c))
c=pure<$>['A'..'Z']
n=show<$>[1..26]

Try it online!

Stax, 15 bytes
Ö└╝╨→ε/óo↕[▄╢▐W

Run and debug it
This unpacks to the following 18 bytes:
cc%!{64+z+}{E64-}?

Run and debug it

Thunno 2, 1 byte
Ä

Attempt This Online!
Overloaded built-in that works on both numbers (1 -> A, 2 -> B, ...) and letters (A -> 1, B -> 2, ...).

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:
Number Plate Golf: Parsing
See Also: Recognition
Introduction
You've now been taken off the speed camera development team (let's face it, your code is nowhere near production code standards) and are now working on a program to extract information about the car from the number plates. Of course, you've caught the code golf bug and want to write the program in as few bytes as possible.
Challenge
Given a valid, British number plate, display information about the car's registration.
You only have to support number plates registered between 2001 and 2051 (inclusive).
Internet access is disallowed.
The input will be given as a string.
Number Plates
British number plates are ordered like so:

Area code
A table with all of the area code mnemonics which you need to support can be found here.
For the letter X, you only need to output Personal Export due to multiple areas being covered by the same mnemonic.
You must output the DVLA office name.
Age Identifier
Similarly, a table with all of the age identifiers which you need to support can be found here.
If the identifier is in the range Y to 50 inclusive, you must output:
1/3/[Year] to 31/8/[Year]

Likewise, if the identifier is in the range 51 to 00 inclusive, you must output:
1/9/[Year] to [28/29]/2/[Year + 1]

You should support leap years.
Examples
WK94 FRS
Truro, 1/9/2044 to 28/2/2045

CB16 BTD
Bangor, 1/3/2016 to 31/8/2016

BD51 SMR
Birmingham, 1/9/2011 to 29/2/2012

XAY EEA
Personal Export, 1/3/2001 to 31/8/2001

Scoring
The shortest code in bytes wins

Are we allowed to fetch online data?

@R.Kap No, you should not

The output for BD51 ANY should read Birmingham, 1/9/2001 to 28/2/2002, I think you meant BD61 for leap year demo purposes?

Not quite Area 51...

One side effect of this challenge: Every time I see a car or motorcycle with GB plates, I try to decode them in my head. :-)

Ruby, 629 bytes
s=gets
p=c=0
'PETeRborOuGh
NORWich
IPSwicH
BIRMiNGHam
CARdiff
SWANsea
BAngOr
CHEsTer
SHREWsbURY
CHELmSFOrd
NOTTInGHAm
LInCOlN
MAIDStone
BRIgHtON
BOURNEMoUth
PORTSMoUth
ISLE OF WIGHt
PORtSmOUtH
BOREHAMwoOD
NORTHAmPton
WIMBLeDoN
BOREHAMwOoD
SIdcup
MANChESTer
NEWCAstle
STOcKtON
oXFOrd
PReStON
CArlISlE
ReADIng
GLAsGoW
EDINBUrGh
DUNdEe
ABERDEen
INvErNEsS
WORcESTer
EXeTeR
TRUro
BRiStoL
PERSONAL eXPOrt
LeEds
SHEFFiElD
BEVERLEY'.split($/).map{|w|c<s[0,2].to_i(35)&&p=w;d=0;w.bytes{|b|d+=d+b/95};c+=d}
y=(?1+s[2,9]).to_i-1
puts p.capitalize+", 1/%d/20%02d to %d/%d/20%02d"%[z=3+y%100/50*6,1+y%=50,z<4?31:y%4==2?29:28,(z+5)%12,1+y+z/9]

The first two letters are interpreted as a base 35 number and then looked up to find the correct town. The quantity of addresses assigned to each town is encoded (run-length encoding) in the captialization of each town in binary, where uppercase=0 and lowercase=1.
In order to handle the Y age indicator for the first half of 2001, a 1 is prepended to the age. Thus 1 Y is interpreted by .to_i as 1, and 1 02 is interpreted as 102. 1 is subtracted (to handle the wraparound for 2050) and taken modulo 100 to decide which half of the year we are in. It is then taken modulo 50 (and the 1 added on again) to find the year.

Nice! You're lucky most of the names are only one word. However, "Isle of wight" is incorrectly capitalized. ;-)

Your code contains errors, unfortunately. In addition to the minor mistake of not capitalizing the "wight" in "Isle of Wight", for the test case in Birmingham it yields "28/2/2012" instead of "29/2/2012", because 2012 is a leap year.

Sorry! It's actually the example that's wrong. Your code correctly accounts for leap years.

PHP, 1044 800 757 bytes
The script is added to a PHAR (PHP archive) and compressed with gzip to shrink it from 1044 to 800 bytes. Further optimization took the original code down to 994 bytes, which then as a Phar is 757 bytes. Takes the license plate string as the first argument like php u.phar BD51 SMR (actually the latter part is read as "second argument", but useless garbage anyway for this challenge).
Download the uklic.phar file for this answer
This is the script before compression:
<?$o=[X=>'Personal export',B=>Birmingham,E=>Chelmsford,M=>Manchester,O=>Oxford,R=>Reading,V=>Worcester,A=>['A-N'=>Peterborough,'O-U'=>Norwich,'V-Y'=>Ipswich],C=>['A-O'=>Cardiff,'P-V'=>Swansea,WXY=>Bangor],D=>['A-K'=>Chester,'L-Y'=>Shrewsbury],F=>['A-P'=>Nottingham,'R-Y'=>Lincoln],G=>['A-O'=>Maidstone,'P-Y'=>Brighton],H=>['A-J'=>Bournemouth,'K-Y'=>Portsmouth,W=>'Isle of Wight'],K=>['A-L'=>Borehamwood,'M-Y'=>Northampton],L=>['A-J'=>Wimbledon,'K-T'=>Borehamwood,'U-Y'=>Sidcup],N=>['A-O'=>Newcastle,'P-Y'=>Stockton],P=>['A-T'=>Preston,'U-Y'=>Carlisle],S=>['A-J'=>Glasgow,'K-O'=>Edinburgh,'P-T'=>Dundee,UVW=>Aberdeen,XY=>Inverness],W=>['A-J'=>Exeter,KL=>Truro,'M-Y'=>Bristol],Y=>['A-K'=>Leeds,'L-U'=>Sheffield,'V-Y'=>Beverley]];$p=$argv[1];$a=$o[$p{0}];$z=$a;if(count($a)>1){foreach($a as$r=>$d){if(preg_match("/[$r]/",$p{1})){$z=$d;}}}$n=$p{2}.$p{3};$y=$n+($n==Y);if($y==0)$y=50;$h=$y&&$n<51;$y%=50;$x=$y+1;printf('%s, 1/%s/20%02d to %s/20%02d',$z,$h?3:9,$y,$h?'31/8':28+!($x%4).'/2',$h?$y:$x);

The DVLA Office lookup is a simple map with a string if the first character of the license plate is enough to identify the office and an array if we need the second character. The character range is then matched with a simple regexp.
The code for the date range is quite easy except for the two edge cases "Y" and "00", which can't be calculated. Y is cast to integer and added a 1, in case the input is an integer. That's how we get 2001 for Y. 00 is accounted for by modulo arithmetic.
This is the slightly better readable version:
<?
$o = [
  X => 'Personal export',
  B => Birmingham,
  E => Chelmsford,
  M => Manchester,
  O => Oxford,
  R => Reading,
  V => Worcester,
  A => ['A-N' => Peterborough, 'O-U' => Norwich, 'V-Y' => Ipswich],
  C => ['A-O' => Cardiff, 'P-V' => Swansea, WXY => Bangor],
  D => ['A-K' => Chester, 'L-Y' => Shrewsbury],
  F => ['A-P' => Nottingham, 'R-Y' => Lincoln],
  G => ['A-O' => Maidstone, 'P-Y' => Brighton],
  H => ['A-J' => Bournemouth, 'K-Y' => Portsmouth, W => 'Isle of Wight'],
  K => ['A-L' => Borehamwood, 'M-Y' => Northampton],
  L => ['A-J' => Wimbledon, 'K-T' => Borehamwood, 'U-Y' => Sidcup],
  N => ['A-O' => Newcastle, 'P-Y' => Stockton],
  P => ['A-T' => Preston, 'U-Y' => Carlisle],
  S => ['A-J' => Glasgow, 'K-O' => Edinburgh, 'P-T' => Dundee, UVW => Aberdeen, XY => Inverness],
  W => ['A-J' => Exeter, 'KL' => Truro, 'M-Y' => Bristol],
  Y => ['A-K' => Leeds, 'L-U' => Sheffield, 'V-Y' => Beverley]
];
$p=$argv[1];

$a=$o[$p{0}];
$z=$a;
if (count($a)-1) {
    foreach($a as $r => $d) {
        if (preg_match('/['.$r.']/', $p{1})) {$z=$d; }
    }
}
$n=$p{2}.$p{3};
$y=$n+($n==Y);
if ($y==0) {
    $y=50;
}
$h=$y&&$n<51;
$y%=50;
$x=$y+1;
printf('%s, 1/%s/20%02d to %s/20%02d',$z,$h?3:9,$y,$h?'31/8':28+!($x%4).'/2',$h?$y:$x);

Updates:

Seriously trimmed down the date calculation section and made use of printf, replaced is_array($a) with `count($a)>1
Optimized the Phar bootstrapping

Great idea with the string arguments :D

Thanks! :-) Actually, with the magic of PHAR, I can compress it down to 800 bytes exactly. But I don't know if that's within the spirit of the competition.

If it's a compression library, you can use it

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


text:
Hiding elements with CSS only
In the following markup without changing it or using JS, implement the behavior to show only the ul element of div which name is clicked in the first ul (before div). Name is content of li in top ul and it matches the content of the first li in ul you want to show. Elements that have {content} are just fillers and have no meaning for problem.

Favourite dishes

Breakfasts

Dinners

Suppers

Breakfasts

{Breakfast 1}

{Breakfast 2}

{Breakfast 3}

Dinners

{Dinner 1}

{Dinner 2}

{Dinner 3}

Dinners

{Supper 1}

{Supper 2}

{Supper 3}

Favourites

{Favourite 1}

{Favourite 2}

{Favourite 3}

This problem really has the solution and was very interesting for me, so I decided to post it here even if it's not very practical.
Hint: you have to use :target pseudo-class.

Note, I don't believe this is off-topic, as it looks like a [tag:programming-puzzle] to me

@NathanMerill Programming puzzle or not, it still needs an objective winning criterion.

@Dennis isn't it first posted by default?

@NathanMerrill Amended: first corrected posted

@NathanMerrill As far as I know, no. The tag doesn't even have a wiki.

I think your hint gave too much away:
div>ul:target{
   display: block;
}
div>ul{
   display: none;
}

thanks for proposing a solution, it's almost it, but if I click the "Favourite dishes", nothing is shown