The Symbols vs. The Letters

Python (Symbols, 87 82)

from string import punctuation
from string import digits
print digits
print punctuation

I just love Python's string module...

Edit:

from string import punctuation as p
from string import digits as d
print d
print p

Output:

0123456789
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

FALSE (Letters, 21) DUP (Letters, 20):

FALSE solution:

65[$91\>][$,$32+,1+]#

DUP sollution (1 char shorter)

65[$91<][$,$32+,1+]#

Output (for both):

AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz

Interpreter for FALSE.


Total: 102


GolfScript (14 chars) + Deadfish x (116 chars) = 130 chars

91,65>{.32+}%+

and

xxcxxcdddKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKDxxxccxxxxxxxxxxKxKxKxKxKxKDxxxcxxcxxKxKxKxK

Parts 1 and 2 in Ruby 2, 56 + 484 = 540

Part 1:

__=->_{(91..96)===_||$><<(''<<_);_>121||__[-~_]}
__[65]

For more on this style of Ruby, check out narfnme.

Part 2 (this bit is Ruby 2.0+ only, works perfectly with ruby-2.1.0 but may give warnings in earlier versions):

class Fixnum
def c
String def a
end
end
def b
String def A
end
end
def x
String def z
end
end
def y
String def Z
end
end
def inspect
case chr
when c
when b
when y
p succ
else
print chr
p succ
end
p
rescue
p
end
end
def x
String def z
end
end
def y
String def Z
end
end
class String
def inspect
p size
p
end
end
p String p
class String
def inspect
p ord
p
end
end
p y
class Fixnum
def inspect
case chr
when x
p succ
else
send chr
print chr
p
end
p
rescue
print chr
p succ
p
end
end
p x

That one was hard. Calling built-in Fixnum methods like chr and succ requires opening up the Fixnum class and redefining inspect, since I can trigger a call to x.inspect with p x. I need inspect to return nil so that p will only print a newline, any string will be framed in double quotes. But as a side effect, it loops. I can terminate the first loop and second loops using a string comparison to see when I've reached a letter range, but since I can't write a string literal I need to get one by calling String() on the symbol returned (in Ruby 2) by the def keyword. Since that's a multiline syntax and I can only do string comparison via case, which can't take multiline expressions, I need to wrap the literal in a method (since I obviously can't do assignment). The last loop is harder to terminate. I need it to stop at ~. Luckily, of the ascii characters in that range, ~ is the only one that can be called on a Fixnum with no arguments without raising an error, so I can use send chr to detect when I'm at the end and stop looping.

Not the best score in this thread, but thus far the only one that uses the same language for both parts. Yay Ruby.