1 Replies - 1053 Views - Last Post: 26 September 2010 - 07:41 AM Rate Topic: -----

#1 Guest_yurimano*


Reputation:

Translator e.g. English to French

Posted 26 September 2010 - 12:39 AM

i have been able to do the translation for single words only, but not for simple sentences.
i tried splitting my sentence into a list of strings, but then i cannot compare the elements in the list with my dictionary file of words (i get this: TypeError: 'list' object is not callable)
is there any way i can access the strings to compare each string with the words in my dictionary file?e.g. something like
 if listname(position_in_list)== filename(position_in_file) 


thx

Is This A Good Question/Topic? 0

Replies To: Translator e.g. English to French

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,023
  • Joined: 15-July 08

Re: Translator e.g. English to French

Posted 26 September 2010 - 07:41 AM

To get the index/position of a list, you use square brackets, not parentheses.

if listname[position_in_list]== filename[position_in_file]


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1