Python Daily Question - 134
Step by step Explanation:-
1. List Initialization:
a = ['Nani', 'Anu']
A list a is created with two elements: 'Nani' and 'Anu'.
2. For Loop:
for i in a:
print(i)
This loop iterates over each element in the list a.
In the first iteration, i is 'Nani' and it prints 'Nani'.
In the second iteration, i is 'Anu' and it prints 'Anu'.
3. Else Block:
else:
print("Mani")
The else block in a for loop is executed when the loop completes all its iterations normally (i.e., without encountering a break statement).
After the loop has finished iterating over all elements in the list, it executes the else block and prints "Mani".
Summary:
The code iterates over the list a, printing each element, and then prints "Mani" after the loop has finished.
Final Answer :
Nani
Anu
Mani
#coding_with_mani #python #code #viral #youtubeshorts #shorts #short #youtube #code #india #code #viral #youtubeshorts #shorts #short #youtube #code #india
#pythonquestions #python #coding #youtube #pythonprogramming #code #programminglanguage #pythonprogramming
#shorts #python #code #viral #trending #youtubeshorts #sql #sqlserver #data #database #daily #dailyshorts #dailyquestions #dailyseries