The document is a worksheet for Class XI students on the topic of Selection Constructs in Python. It includes practical questions related to syntax, error identification, and code correction. Students are encouraged to practice these questions on their PCs before submission.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views2 pages
Class XI IP If Else Practical
The document is a worksheet for Class XI students on the topic of Selection Constructs in Python. It includes practical questions related to syntax, error identification, and code correction. Students are encouraged to practice these questions on their PCs before submission.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
GULF INDIAN HIGH SCHOOL
Class: XI Informatics Practices Date of submission:
Worksheet Topic: Selection Constructs in Note: Practice these
Python practical questions on your PC Section A 1. What are the Selection Constructs available in Python? 2. Write the syntax of simple if statement? 3. Write the syntax of if..else statement? 4. Identify and correct the problem with following code: if( x=1) M = 50 else M=15 5. What will be the output of the following code fragment? I) if a = 25 ii) a=12 iii) if a=48 if ( a % 3 == 0 and a % 4 ==0): b = a * 10 elif (a%8 ==0): b = a + 50 else: b = a * 20 print(“Result”, b) 6. What are the error(s) in the following code? Correct the code. a, b = 30, 15 if a%3 = 0 : c=b*3 print(“Result = ”,c) Elif a%5 == 0 d=b*5 Print(“Result = “,d) else: f==d*10 print(“Result = “,f) 7. Find the errors in the code given below and correct the code: x=25 if d==1 y==x*2 elif : d==2 y=x*3 elif d==3: y=x*20 else y=x*50 print(“Value Y = ”,y) a. What gets printed with the following code? X=True Y=False Z=False if X or Y and Z: print (“Python Lab”) else: print (“MySQL Lab”)