77.3k views
1 vote
What is the iterator (loop) variable in the following?

rest = ["sleep", 'dormir', 'dormire', "slaap", 'sen', 'yuxu', 'yanam']
let = ''
for phrase in rest:
let += phrase[0]
The iterator variable is:_________.

User SamirChen
by
5.3k points

1 Answer

2 votes

Answer:

The iterator variable is phrase

Step-by-step explanation:

Given:

The above code segment

Required

Determine the iterator variable

The given code segment is written in python;

To determine the iterator variable, we simply make use of the following syntax:

for iterator-variable in iterable:

Compare this syntax to the instruction on line 3

for phrase in rest:

We have that the

iterator-variable = phrase

User Jkjustjoshing
by
4.4k points