CBSE Class 10 Computer Applications Question 12 of 17

Python Conditionals and Loops — Question 12

Back to all questions
12
Question

Question 9(a)

Predict the output of the following code fragments :

count = 0 
while count < 10: 
    print "Hello" 
    count += 1 
Answer
Output
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Explanation

The while loop executes 10 times so "Hello" is printed 10 times.

Get the Bright Tutorials app Stuck on a question? Ask Bright Buddy — your AI tutor — for step-by-step help in the app.