Skip to content

Opening book details…

Can I read Wipro Aptitude and Logical Questions on EtoBox?

Wipro Aptitude and Logical Questions by Dummy vedi is a document available to read on EtoBox.

What is Wipro Aptitude and Logical Questions about?

Here is the code to solve this problem: ```python lights = [1,1,0,0,0,1,1,0] # initial state of lights for i in range(len(lights)): if i==0: left = lights[-1] else: left = lights[i-1] if i==len(lights)-1: right = lights[0] else: right = lights[i+1] if left==right: lights[i] = 0 else: lights[i] = 1 print(lights) ``` This code: 1. Initializes the lights array with the initial

Author
Dummy vedi
Language
EN

More by Dummy vedi

Browse all works by Dummy vedi