Embed presentation
Download as PDF, PPTX






![Multiple StatementsFor Syntaxfor var in sequence:statementsExample-v1.1str = "Hello"for ch in str:print(ch, end='')Example-v1.2n = len(str)for i in range(n):print(str[i])](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fcontrolstatements-190509094336%2f75%2fPython-programming-Control-statements-7-2048.jpg&f=jpg&w=240)







![Misc StatementsPass Example-2: Program to retrieve only the negative numbers from the listnum = [1, 2, 3, -4, -5, -6, 7, 8]for i in num:if (i > 0):passelse:print(i)Pass does nothing](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fcontrolstatements-190509094336%2f75%2fPython-programming-Control-statements-15-2048.jpg&f=jpg&w=240)





The document provides an overview of control statements in programming, including single and multiple statements for control flow using 'if', 'if-else', 'while', and 'for'. It includes syntax examples and explanations for 'break', 'continue', 'pass', and 'assert', as well as handling exceptions with 'try-except'. The content serves as a guide for understanding how to implement control statements and handle conditions in code.






![Multiple StatementsFor Syntaxfor var in sequence:statementsExample-v1.1str = "Hello"for ch in str:print(ch, end='')Example-v1.2n = len(str)for i in range(n):print(str[i])](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fcontrolstatements-190509094336%2f75%2fPython-programming-Control-statements-7-2048.jpg&f=jpg&w=240)







![Misc StatementsPass Example-2: Program to retrieve only the negative numbers from the listnum = [1, 2, 3, -4, -5, -6, 7, 8]for i in num:if (i > 0):passelse:print(i)Pass does nothing](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fcontrolstatements-190509094336%2f75%2fPython-programming-Control-statements-15-2048.jpg&f=jpg&w=240)



