Myntra Interview Question | Simple Loop problem
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 8 )
i=0
while i < 50:
i += 1
if i == 5 or i == 10 or i == 15:
continue
print(i, end=' ')
num = 0
while num <= 50:
num = num + 1
if num == 5 or num == 10 or num == 15:
continue
print(num)
i=0
while i<51:
if i in [5,10,15]:
pass
else:
print(i)
Correction:
i=0
while i<51:
if i in [5,10,15]:
pass
else:
print(i)
i+=1
i=0
while i<51:
i+=1
if not (i==5 or i==10 or i==15):
print(i)
continue
i = 0
while i < 50:
i += 1
if i == 5 or i ==10 or i ==15:
continue
print(i)
for i in range(51):
if i in range(5, 16, 5):
continue
print(i)
i = 0
while i<50:
i = i + 1
if i in (5,10,15):
continue
print(i)