QUESTION IMAGE
Question
question 20
what is the output of this program?
fruits = mango, banana, coconut, jackfruit, orange, litchi
for fruit in fruits:
if fruit == coconut:
continue
print(fruit, end= )
Step1: Understand the loop and condition
The program iterates over the fruits list. When fruit == 'Coconut', the continue statement skips the print statement for that iteration.
Step2: Iterate through each element
- For
'Mango':fruit != 'Coconut', soprint('Mango', end=" ")is executed. - For
'Banana':fruit != 'Coconut', soprint('Banana', end=" ")is executed. - For
'Coconut':fruit == 'Coconut', socontinueskips theprintstatement. - For
'Jackfruit':fruit != 'Coconut', soprint('Jackfruit', end=" ")is executed. - For
'Orange':fruit != 'Coconut', soprint('Orange', end=" ")is executed. - For
'Litchi':fruit != 'Coconut', soprint('Litchi', end=" ")is executed.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Mango Banana Jackfruit Orange Litchi