CBSE Class 10 Computer Applications Question 1 of 26

Python Conditionals and Loops — Question 1

Back to all questions
1
Question

Question 1

Consider the following code fragment :

while
    n = 3
    print n == 3

(a) What will be the output of above code ?

(b) What is the reason behind this output ?

Answer

(a) The given code will generate a syntax error.

(b) The condition of while and colon after that is missing. Thus a syntax error is generated.