[Tutor] poll question

spir denis.spir at free.fr
Wed Nov 26 14:22:52 CET 2008


Hello pythonistas,

I need some information about a topic. A list like python tutor is the proper 
place to get it. Take this as a (stupid) game: would you like to answer the 
following question?

Imagine you are writing code. Then, you realise you need a tool function you 
have not yet written. You don't want to stop coding now, rather plan to write 
the func later. So that your code will hold some calls to a not yet defined 
function. Right?
The function is a very short and simple one, indeed: it will return a character 
range, in form of a string such as "0123456789", when passed ASCII ordinals as 
parameters.
How would you call this function? e.g.
digits = char_range(...)
In other words: which is, for you personly, the most practicle or natural way 
of calling this func? Would you give me one or more calling example(s)?  Below 
a list of ASCII characters.

Note: Yes, this is trivial ;-) But there is no trick, no trap. I cannot tell 
the purpose now, because it would invalid the results. I will explain it in 3 
or 4 days when I have some data.
Additional question if you wish: You may try and guess the point of this. But 
do it after answering...

Thank you very much.
Denis


DEC     OCTAL    HEX  CHR  MEANING
---- + ------ + ---- + - + -------- +
#000 | \x0000 | \x00 |   | NUL
#001 | \x0001 | \x01 |   | SOH
#002 | \x0002 | \x02 |   | STX
#003 | \x0003 | \x03 |   | ETX
#004 | \x0004 | \x04 |   | EOT
#005 | \x0005 | \x05 |   | ENQ
#006 | \x0006 | \x06 |   | ACK
#007 | \x0007 | \x07 |   | BEL
#008 | \x0010 | \x08 |   | BS
#009 | \x0011 | \x09 |   | HT
#010 | \x0012 | \x0A |   | LF or NL
#011 | \x0013 | \x0B |   | VT
#012 | \x0014 | \x0C |   | NP
#013 | \x0015 | \x0D |   | CR
#014 | \x0016 | \x0E |   | SO
#015 | \x0017 | \x0F |   | SI
#016 | \x0020 | \x10 |   | DLE
#017 | \x0021 | \x11 |   | DC1
#018 | \x0022 | \x12 |   | DC2
#019 | \x0023 | \x13 |   | DC3
#020 | \x0024 | \x14 |   | DC4
#021 | \x0025 | \x15 |   | NAK
#022 | \x0026 | \x16 |   | SYN
#023 | \x0027 | \x17 |   | ETB
#024 | \x0030 | \x18 |   | CAN
#025 | \x0031 | \x19 |   | EM
#026 | \x0032 | \x1A |   | SUB
#027 | \x0033 | \x1B |   | ESC
#028 | \x0034 | \x1C |   | FS
#029 | \x0035 | \x1D |   | GS
#030 | \x0036 | \x1E |   | RS
#031 | \x0037 | \x1F |   | US
#032 | \x0040 | \x20 |   | Space SP
#033 | \x0041 | \x21 | ! | Exclamation mark
#034 | \x0042 | \x22 | " | Quotation mark &quot
#035 | \x0043 | \x23 | # | Number sign
#036 | \x0044 | \x24 | $ | Dollar sign
#037 | \x0045 | \x25 | % | Percent sign
#038 | \x0046 | \x26 | & | Ampersand &amp
#039 | \x0047 | \x27 | ' | Apostrophe right single quote
#040 | \x0050 | \x28 | ( | Left parenthesis
#041 | \x0051 | \x29 | ) | Right parenthesis
#042 | \x0052 | \x2A | * | Asterisk
#043 | \x0053 | \x2B | + | Plus sign
#044 | \x0054 | \x2C | , | Comma
#045 | \x0055 | \x2D | - | Hyphen
#046 | \x0056 | \x2E | . | Period fullstop
#047 | \x0057 | \x2F | / | Solidus slash
#048 | \x0060 | \x30 | 0 | Digit 0
......	  ...	...			...
#057 | \x0071 | \x39 | 9 | Digit 9
#058 | \x0072 | \x3A | : | Colon
#059 | \x0073 | \x3B | ; | Semi-colon
#060 | \x0074 | \x3C | < | Less than &lt
#061 | \x0075 | \x3D | = | Equals sign
#062 | \x0076 | \x3E | > | Greater than &gt
#063 | \x0077 | \x3F | ? | Question mark
#064 | \x0100 | \x40 | @ | Commercial at-sign
#065 | \x0101 | \x41 | A | Uppercase letter A
......	  ...	...			...
#090 | \x0132 | \x5A | Z | Uppercase letter Z
#091 | \x0133 | \x5B | [ | Left square bracket
#092 | \x0134 | \x5C | 0 | Reverse solidus backslash
#093 | \x0135 | \x5D | ] | Right square bracket
#094 | \x0136 | \x5E | ^ | Caret
#095 | \x0137 | \x5F | _ | Horizontal bar underscore
#096 | \x0140 | \x60 | ` | Reverse apostrophe left single quote
#097 | \x0141 | \x61 | a | Lowercase letter a
. . .
#122 | \x0172 | \x7A | z | Lowercase letter z
#123 | \x0173 | \x7B | { | Left curly brace
#124 | \x0174 | \x7C | | | Vertical bar
#125 | \x0175 | \x7D | } | Right curly brace
#126 | \x0176 | \x7E | ~ | Tilde
#127 | \x0177 | \x7F |   | DEL


More information about the Tutor mailing list