![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
SOLVED Dictionary with two different languages ?
I would like to construct a dictionary that would contain two different languages.
Could someone give me an example of how this might be accomplished? Thank You Pywacky Last edited by pywacky; Mar 8th, 2005 at 9:42 AM. |
|
|
|
|
|
#2 |
|
Professional Programmer
|
just make 2 dictionaries and run the word you're checking through both.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
Solved
HOLD IT ! My poor old brain finally figured out what you meant. All is well, problem solved.
Many thanks Last edited by pywacky; Mar 8th, 2005 at 9:42 AM. |
|
|
|
|
|
#4 | |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Quote:
utch dictionary, how could you convert that to a Dutch:English dictionary? Any ideas?
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
|
#5 | |
|
Newbie
Join Date: Feb 2005
Posts: 10
Rep Power: 0
![]() |
Quote:
def reversedict(original_dict):
dict2 = {}
dict_list = original_dict.items()
for i in dict_list:
dict2[i[1]] = i[0]
return dict2
# Dict 1 is just for the purpose of example, you could feed this function
# Any dictionary.
dict1 = {1: 'a', 2: 'b', 3: 'c', 4: 'd'}
dict3 = reversedict(dict1)
print dict3 |
|
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Thank you, that's it. I figured it had to be a loop or some built-in method. Now you can make both dictionaries if you have one of them.
__________________
I looked it up on the Intergnats! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|