English

Find the errors from the given code. i=10 ; while [i<=n] : print i i+=1

Advertisements
Advertisements

Question

Find the errors from the given code.

i=10 ;
while [i<=n] :
    print i
   i+=1
Very Short Answer
Advertisements

Solution

Errors: Square brackets cannot be used around the while condition, and n must be assigned a value before use.

shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Review of Phython - EXERCISE [Page 26]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 1 Review of Phython
EXERCISE | Q 8. c. | Page 26
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×