CBSE Class 12 Computer Science
Question 80 of 105
Python Revision Tour II — Question 7
Back to all questions
1 #
1 # 2 #
1 # 2 # 3 #
Numbersis a list containing the numbers 9, 18, 27, and 36.- The outer for loop iterates over each element in the list
Numbers. - The inner loop iterates over the range from 1 to the remainder of Num divided by 8. For example, if Num is 9, the range will be from 1 to 1 (9 % 8 = 1). If Num is 18, the range will be from 1 to 2 (18 % 8 = 2), and so on. Then it prints the value of N, followed by a "#", and ensures that the output is printed on the same line by setting end=" ".
- After both loops, it prints an empty line, effectively adding a newline character to the output.