Essay on The Republic Day | Republic Day Essay in English
[ Festival Ganesh Chaturthi Essay in English for Students and Children ] [ Essay on my favourite freedom fighter ] ⚔️ [ दुर्गा पूजा पर निबंध (Durga Puja Hindi Essay) ]
[Essay On 75th Independence Day Of India] [Azadi Ka Amrit Mahotsav Essay in English]

Which of the following loops prints “Welcome to Python” 10 times?
A

Loading

Practice for loop Questions – Which of the following loops prints “Welcome to Python” 10 times?
A:
for count in range(110):
    print(“Welcome to Python”)
B:
for count in range(010):
    print(“Welcome to Python”)
C:
for count in range(111):
  print(“Welcome to Python”)
D:
for count in range(112):
  print(“Welcome to Python”)

Which of the following loops correctly computes 1/2 + 2/3 + 3/4 + …

Loading

Practice for loop Questions – Which of the following loops correctly computes 1/2 + 2/3 + 3/4 + … + 99/100?
A:
sum = 0
for i in range(199):
    sum += i / (i + 1)
print(“Sum is”, sum)
B:
sum = 0
for i in range(1100):
    sum += i / (i + 1)
print(“Sum is”, sum)
C:
sum = 0
for i in range(1.099.0):
    sum += i / (i + 1)
print(“Sum is”, sum)
D:
sum = 0
for i in range(1.0100.0):
    sum += i / (i + 1)
print(“Sum is”, sum)

Given the following four patterns,
Pattern A   

Loading

Practice for loop Questions – Given the following four patterns,
Pattern A        Pattern B        Pattern C        Pattern D
1                1 2 3 4 5 6                1      1 2 3 4 5 6
1 2              1 2 3 4 5                2 1        1 2 3 4 5
1 2 3            1 2 3 4                3 2 1          1 2 3 4
1 2 3 4          1 2 3                4 3 2 1            1 2 3
1 2 3 4 5        1 2                5 4 3 2 1              1 2
1 2 3 4 5 6      1                6 5 4 3 2 1                1
Which of the pattern is produced by the following code?
for i in range(16 + 1):
    for j in range(6, 0, 1):
       print(j if j <= i else” “, end = ” “)
    print()