Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vocabulary indexing?
#5
Yes, vocabulary .get(direction) works for what I needed,
Also I corrected my problem by adding an string word=direction
Before the for loop like so

	word=direction
	if len(direction)>1:
		for words in vocab:
				direction = vocab[word]			
Also I get it’s annoying that I keep asking these questions but I feel like every body has to start somewhere and if I don’t ask questions how am I supposed to learn.
There are most likely better ways to use a dictionary but at this point this is what the instructor is doing so I’m following along but trying to grasp a complete understanding before moving on to another section.
Reply


Messages In This Thread
Vocabulary indexing? - by gr3yali3n - Jul-15-2020, 07:34 PM
RE: Vocabulary indexing? - by Yoriz - Jul-15-2020, 08:39 PM
RE: Vocabulary indexing? - by bowlofred - Jul-15-2020, 08:48 PM
RE: Vocabulary indexing? - by deanhystad - Jul-15-2020, 10:30 PM
RE: Vocabulary indexing? - by gr3yali3n - Jul-15-2020, 11:19 PM
RE: Vocabulary indexing? - by deanhystad - Jul-16-2020, 01:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to change 0 based indexing to 1 based indexing in python..?? Ruthra 2 5,984 Jan-22-2020, 05:13 PM
Last Post: Ruthra

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020