Re: [Tutor] Binary 2 text & text 2 binary

2005-09-24 Thread Joseph Quigley
Hi, >From: "R. Alan Monroe" <[EMAIL PROTECTED]> > >They're easy. Just put stuff in square brackets with commas between. > >mycoollist = [1,5,9,3,6,9,2,6] >mystringlist = ['a', 'u', 'e', 'b', 'd', 'h', 'q', 't'] > > Ah sorry I forgot to say: I know how to print them but that's about it. >Can you

Re: [Tutor] Binary 2 text & text 2 binary

2005-09-24 Thread Poor Yorick
Pujo Aji wrote: > If your symbol are specific it is better to use dictionary. > then if the user give an input you can take character by character and > translate into your binary. > This is the code textTobinary: > mydic = {'A' : "0101", 'B' : "0110", 'C' : "0111"} > strinput

Re: [Tutor] Binary 2 text & text 2 binary

2005-09-24 Thread Pujo Aji
If your symbol are specific it is better to use dictionary. then if the user give an input you can take character by character and translate into your binary. This is the code textTobinary:     mydic = {'A' : "0101", 'B' : "0110", 'C' : "0111"}    strinput = 'ABBC'    result = [mydic[x]

Re: [Tutor] Binary 2 text & text 2 binary

2005-09-23 Thread R. Alan Monroe
> I thought lists would be the best but I really don't know how to use > them They're easy. Just put stuff in square brackets with commas between. mycoollist = [1,5,9,3,6,9,2,6] mystringlist = ['a', 'u', 'e', 'b', 'd', 'h', 'q', 't'] Can you predict what this code will do? print mycoollist[0]

[Tutor] Binary 2 text & text 2 binary

2005-09-23 Thread Joseph Quigley
Hi I'm playing with a Binary to text & text to binary converter. I can't figure out how to replace the characters (first stage: text to binary). I thought lists would be the best but I really don't know how to use them... here's my code: #! /usr/bin/env python A = "0101" B = "0110" C = "