0

what is the use of word=words[counter]

7th Aug 2016, 1:39 PM
adamsharief
adamsharief - avatar
2 Answers
0
words[] is an array of strings such as [apple, pineapple, tomato] when you talk about words[counter] the object you refer is a string such as words[0] = apple words[1] = pineapple so on >>word = words[2] >>print word tomato
8th Aug 2016, 7:59 AM
Gonzalo De Benito CassadĂł
Gonzalo De Benito CassadĂł - avatar
0
counter just gives out the index of the word it just counted. In above example counter of 'apple' is 0. Thus word[counter] is same as word[0]
3rd Sep 2016, 5:00 PM
Kshitij Joshi
Kshitij Joshi - avatar