Re: Problem with list.insert

2008-08-29 Thread John Machin
On Aug 29, 5:10 pm, SUBHABRATA <[EMAIL PROTECTED]> wrote: > Dear group, > Thanx for your idea to use dictionary instead of a list. Your code is > more or less, OK, some problems are there, I'll debug them. Well, I > feel the insert problem is coming because of the Hindi thing. It's nothing to do w

Re: Problem with list.insert

2008-08-29 Thread SUBHABRATA
Dear group, Thanx for your idea to use dictionary instead of a list. Your code is more or less, OK, some problems are there, I'll debug them. Well, I feel the insert problem is coming because of the Hindi thing. And Python2.5 is supporting Hindi quite fluently. I am writing in Python2.5.1. Best Reg

Re: Problem with list.insert

2008-08-28 Thread Terry Reedy
SUBHABRATA, I recommend you study this excellent response carefully. castironpi wrote: On Aug 28, 11:13 am, SUBHABRATA <[EMAIL PROTECTED]> wrote: -. Instead split up your inputs first thing. trans= { 'a': 'A', 'at': 'AT', 'to': 'TO' } sample= 'a boy at the park walked to the tree' expected= '

Re: Problem with list.insert

2008-08-28 Thread castironpi
On Aug 28, 11:13 am, SUBHABRATA <[EMAIL PROTECTED]> wrote: > Dear Group, > I wrote one program, > There is a dictionary. > There is an input string. > Every word of input string the word is matched against the dictionary > If the word of input string is matched against the dictionary it gives > the

Re: Problem with list.insert

2008-08-28 Thread bearophileHUGS
Subhabrata, it's very difficult for me to understand what your short program has to do, or what you say. I think that formatting and code style are important. So I suggest you to give meaningful names to all your variable names, to remove unused variables (like n), to add blank likes here and ther

Re: Problem with list.insert

2008-08-28 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: SUBHABRATA schrieb: Some people in the room told I am kidding, but I learnt Python from Python docs which gives examples like these, But I write explicit comments, an excerpt from python docs: # Measure some strings: ... a = ['cat', 'window', 'defenestrate'] for x in a

Re: Problem with list.insert

2008-08-28 Thread Diez B. Roggisch
SUBHABRATA schrieb: Some people in the room told I am kidding, but I learnt Python from Python docs which gives examples like these, But I write explicit comments, an excerpt from python docs: # Measure some strings: ... a = ['cat', 'window', 'defenestrate'] for x in a: ... print x, len(x)

Re: Problem with list.insert

2008-08-28 Thread SUBHABRATA
Some people in the room told I am kidding, but I learnt Python from Python docs which gives examples like these, But I write explicit comments, an excerpt from python docs: # Measure some strings: ... a = ['cat', 'window', 'defenestrate'] >>> for x in a: ... print x, len(x) ... cat 3 window 6 d

Re: Problem with list.insert

2008-08-28 Thread Marc 'BlackJack' Rintsch
On Thu, 28 Aug 2008 09:13:00 -0700, SUBHABRATA wrote: > import re > def wordchecker1(n): > # INPUTTING STRING > a1=raw_input("PRINT ONE ENGLISH SENTENCE FOR DICTIONARY CHECK:") > #CONVERTING TO LOWER CASE > a2=a1.lower() > #CONVERTING INTO LIST > a3=a2.split() > #DICTIO

Problem with list.insert

2008-08-28 Thread SUBHABRATA
Dear Group, I wrote one program, There is a dictionary. There is an input string. Every word of input string the word is matched against the dictionary If the word of input string is matched against the dictionary it gives the word of the dictionary. But if it does not find it gives the original wo