+1 vote
1.5k views
in Computer by (71.7k points)
reopened by

How many times will Python execute the code inside the following while loop?

i = 1

while i < 10000 and i > 0 and 1:

print “ Hello ...”

i = 2 * i

Please log in or register to answer this question.

2 Answers

+2 votes
by (89.0k points)

14 times will Python execute the code inside the following while loop.

by (12 points)
+1
can you please explain why ?
+1 vote
by (20 points)
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...
Hello ...

Process finished.

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...