Computer Science, asked by Knhf6807, 8 months ago

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

Answers

Answered by vineelagopi2018
1

Answer:

phrase

Explanation:

as it is used for the iteration

Answered by poojan
1

'phrase' is the iterator variable in the loop of the given code.

Explanation:

Given code:

rest = ["sleep", 'dormir', 'dormire', "slaap", 'sen', 'yuxu', 'yanam']

let = ''

for phrase in rest:

let += phrase[0]

  • Here, 'rest' is iterable of a list type.
  • The element of this iterable is run over a for loop, using an iterator variable 'phrase'.
  • On each iteration, a value from the iterable 'rest' is stored into the iterator variable 'phrase' to perform the action in the body of the loop.

Learn more:

1. Ch+=2 is equivalent to​

https://brainly.in/question/21331324

2. A CSS file cannot be linked to a web page. State True or False.

brainly.in/question/21107345

Similar questions