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
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
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]
> 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]
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 = "