||JAI SRI GURUDEV||
Sri Adichunchanagiri Shikshana Trust ®
SJB INSTITUTE OF TECHNOLOGY
An Autonomous Institution under Visvesvaraya Technological University, Belagavi
Approved by AICTE, New Delhi, Accredited by NAAC, New Delhi with ‘A+’ Grade, Accredited by National Board of Accreditation, New Delhi
Recognized by UGC, New Delhi with 2(f) and 12(B), Certified by ISO 9001-2015
No. 67, BGS Health & Education City, Dr. Vishnuvardhan Road, Kengeri, Bengaluru - 560 060
Department of Computer Science & Engineering (Data Science)
Course Name: Python Programming for Data Science Course Code: 23CDE312
Faculty: Mrs. Jasma Bhavani B
Question Bank
Module 2
Decision Structure
1. Explain algorithm and discuss the three basic control structures with examples.
2. Write a detailed note on forming conditions in Python. Explain boolean, relational, and logical
expressions with examples.
3. Explain the if statement with syntax and examples. Also discuss indentation.
4. Explain if-else statement with syntax, flow, and examples.
5. What is inline if (ternary operator)? Explain its syntax and give suitable examples.
6. Explain the if-elif ladder with syntax, flow of control and examples.
7. Explain nested-if statements with examples. When do we use nested-if?
8. What is a loop? Explain the need and advantages of loops with examples.
9. Classify flow control in Python and explain definite, indefinite, entry-controlled, and exit-controlled
loops.
10. Explain range() function in detail with all forms and examples.
11. Explain enumerate() function with syntax, purpose, and examples.
12. Explain while loop with syntax, working, and examples.
13. Explain while-else block with syntax and examples demonstrating both normal and break usage.
14. Explain for loop with syntax and examples. Why is it called a sequence-based loop?
15. Explain nested for loop with suitable examples.
16. Explain while loop inside for loop with examples.
17. Explain nested while loops with syntax and a working example.
18. Explain break statement. Describe its working and flow of control with examples.
19. Explain continue statement. How does it differ from break? Give examples.
||JAI SRI GURUDEV||
Sri Adichunchanagiri Shikshana Trust ®
SJB INSTITUTE OF TECHNOLOGY
An Autonomous Institution under Visvesvaraya Technological University, Belagavi
Approved by AICTE, New Delhi, Accredited by NAAC, New Delhi with ‘A+’ Grade, Accredited by National Board of Accreditation, New Delhi
Recognized by UGC, New Delhi with 2(f) and 12(B), Certified by ISO 9001-2015
No. 67, BGS Health & Education City, Dr. Vishnuvardhan Road, Kengeri, Bengaluru - 560 060
Department of Computer Science & Engineering (Data Science)
20. Write a note on pass statement. Explain its uses in empty loops, classes, functions, and conditional
blocks.