This document discusses control statements in Python programming. It covers sequential, selection, and iterative control statements including if, if-else, nested if, if-elif-else, while loops, for loops, break, continue, pass, and else statements used with loops. Control statements allow programmers to control the flow and execution of code by making decisions or repeating actions.
Control statements determine the flow and order of execution of program instructions. There are three main types: sequential execution from top to bottom, selection of certain statements using if/else, and iterative execution of statements using loops like while and for. Looping constructs allow repeating steps until a condition is met and include features like break to exit early, continue to skip to next step, and else to execute after normal loop completion. Nested loops and conditional statements allow complex control logic.
This document discusses Python programming concepts including data types, operators, expressions, and control flow. It covers core data types like integers, floats, strings, Booleans, lists, and tuples. It also describes arithmetic, comparison, assignment, logical, membership, and identity operators. Control flow concepts explained are if, if-elif-else, for, while loops, and statements like break, continue, and pass. The document is presented by B SNV Ramana Murthy of the computer science department at Aditya College of Engineering & Technology.
First in the series of slides for python programming, covering topics like programming language, python programming constructs, loops and control statements.
Operators and expressions are fundamental concepts in Python programming. The document discusses various types of operators used to manipulate operands, including arithmetic, comparison, assignment, logical, bitwise, and membership operators. It also covers expressions, which are combinations of operators and operands that evaluate to a value. Several types of expressions are described, such as constant, arithmetic, integral, floating, relational, logical, bitwise, and combinational expressions. Control flow statements like if, if-else, if-elif-else are also covered, along with looping using for and while loops and the break, continue, and pass statements.
This document discusses different types of flow control in Python programs. It explains that a program's control flow defines the order of execution and can be altered using control flow statements. There are three main types of control flow: sequential, conditional/selection, and iterative/looping.
Sequential flow executes code lines in order. Conditional/selection statements like if/else allow decisions based on conditions. Iterative/looping statements like for and while loops repeat code for a set number of iterations or as long as a condition is true. Specific conditional statements, loops, and examples are described in more detail.
The document provides an overview of expressions, operators, data types, and control flow statements in Python. It discusses arithmetic, relational, logical, and string expressions. It covers evaluating expressions, operator precedence, implicit and explicit type conversions, and built-in math functions. Control flow statements like if/else, for/while loops, break, continue, and nested loops are explained along with examples. Homework is assigned to write a program to print grades based on marks scored by a student.
The document discusses various topics related to programming in C including data types, constants, expressions, decision making statements, and a sample C program structure. It provides 20 questions with explanations on these topics. It also includes a sample C program to calculate the sum of 10 non-negative numbers entered by the user, illustrating the use of various data types in C programming.
Python uses indentation to define code blocks for decision making statements like if, elif and else. The if statement executes code if a condition is true, elif allows checking multiple conditions, and else runs code if all conditions are false. Loops like while and for repeat code, with while looping until a condition is false and for iterating over a sequence. Nested loops can run inner loops multiple times during outer loop iterations. The else block after a for runs if all iterations complete without breaking from the loop.
This document provides an overview of the Python programming language. It discusses what a program and programming language are, and then describes key features of Python like being simple, interactive, and object-oriented. It explains how to install Python and work in interactive and script modes. The document also covers Python concepts like variables, data types, functions, operators, and control structures like conditional statements and loops.
The document provides an overview of the Python programming language. It discusses features of Python like being simple, easy to learn, versatile, free and open source. It also covers limitations of Python such as being slower than C/C++ for computation heavy tasks. The document describes applications of Python like web development, scientific computing, games development. It then explains basics of Python programming like writing the first program, data types, variables, operators, expressions and lists. Finally, it discusses type conversion and type coercion in Python.
Chapter 9 Conditional and Iterative Statements.pptxXhelalSpahiu
This document provides an overview of conditional and iterative statements in Python. It begins by defining selection and iteration as two types of control structures that allow programs to control the flow of execution.
It then discusses conditional constructs like if/else statements, providing examples of how to write if/else and if/elif/else statements. It also covers loops, specifically while and for loops. The while loop repeats a block of code as long as a condition is true, and for loops iterate over a sequence. Examples are given of using range() and len() with for loops. Finally, the document lists several programming problems suited for different levels that involve conditional and iterative statements.
This document discusses control flow in Python programming. It covers the three types of control flow: sequential, conditional, and iterative execution. Conditional execution uses if, if-else, elif statements to control the flow based on conditions. Iterative execution uses while and for loops to repeatedly execute code. The while loop runs until a condition is false, and the for loop iterates a specific number of times. Break and continue statements can alter the normal flow inside loops. Examples are provided for each control structure. The document concludes with assignments related to control flow concepts in Python.
The document discusses different types of selection statements in C including if, if-else, and switch statements. Relational expressions are used to create conditions for if statements and can be combined using logical operators. An if statement executes a statement if a condition is true, while an if-else statement chooses between two statements depending on the condition. Nested if-else statements and switch statements provide multiway selection. Common errors include misusing assignment versus relational operators and failing to use braces with nested if statements.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlENGWAU TONNY
The document discusses different types of flow control in programming including sequential, selection, and repetition structures. It provides examples of if/else statements, nested ifs, if-else ladders, and the conditional operator. It also covers switch-case statements as an alternative for complex decisions. Finally, it poses challenges for readers to code decision-making structures using if/else and switch-case statements.
The document discusses program statements in Java. It covers:
- The four basic activities of program development: establishing requirements, creating a design, implementing code, and testing.
- Conditional statements like if, if-else, and switch that allow modifying the flow of control through a method.
- Logical operators like && and || that can be used to form complex boolean expressions for conditionals.
The document discusses Python control structures including if-else statements, indentation, and loops. It provides examples of if statements, if-else statements, nested if statements, and elif statements to test conditions and execute code blocks accordingly. It also discusses for loops and the range() function to iterate through sequences and generate number sequences to repeat code. Loops simplify problems by allowing code to repeat without rewriting and help traverse data structures.
The document discusses various Python flow control statements like if/else, while loops, for loops, break and continue. It provides examples and explanations of how each statement works. Key flow control statements covered include if/else for conditional execution, while loops for repetitive execution as long as a condition is true, for loops for executing a block of code a specific number of times, and break/continue for early loop termination or skipping iterations. It also discusses importing modules and functions from the Python standard library.
This document provides an overview of Python programming concepts including what Python is, variables, data types, operators, conditional statements, loops, functions, exceptions, lists, dictionaries, tuples and more. Some key points covered include:
- Python is an interpreted, object-oriented programming language that can be used for many different application types.
- Variables, constants, operators, and control flow structures like conditionals and loops are introduced as the basic building blocks of Python programs.
- Common data types like strings, lists, dictionaries and tuples are described along with their characteristics and functions.
- Other concepts explained are functions, exceptions, formatting, modules and more.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2025/06/state-space-models-vs-transformers-for-ultra-low-power-edge-ai-a-presentation-from-brainchip/
Tony Lewis, Chief Technology Officer at BrainChip, presents the “State-space Models vs. Transformers for Ultra-low-power Edge AI” tutorial at the May 2025 Embedded Vision Summit.
At the embedded edge, choices of language model architectures have profound implications on the ability to meet demanding performance, latency and energy efficiency requirements. In this presentation, Lewis contrasts state-space models (SSMs) with transformers for use in this constrained regime. While transformers rely on a read-write key-value cache, SSMs can be constructed as read-only architectures, enabling the use of novel memory types and reducing power consumption. Furthermore, SSMs require significantly fewer multiply-accumulate units—drastically reducing compute energy and chip area.
New techniques enable distillation-based migration from transformer models such as Llama to SSMs without major performance loss. In latency-sensitive applications, techniques such as precomputing input sequences allow SSMs to achieve sub-100 ms time-to-first-token, enabling real-time interactivity. Lewis presents a detailed side-by-side comparison of these architectures, outlining their trade-offs and opportunities at the extreme edge.
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationChristine Shepherd
AI agents are reshaping logistics and supply chain operations by enabling automation, predictive insights, and real-time decision-making across key functions such as demand forecasting, inventory management, procurement, transportation, and warehouse operations. Powered by technologies like machine learning, NLP, computer vision, and robotic process automation, these agents deliver significant benefits including cost reduction, improved efficiency, greater visibility, and enhanced adaptability to market changes. While practical use cases show measurable gains in areas like dynamic routing and real-time inventory tracking, successful implementation requires careful integration with existing systems, quality data, and strategic scaling. Despite challenges such as data integration and change management, AI agents offer a strong competitive edge, with widespread industry adoption expected by 2025.
More Related Content
Similar to PROBLEM SOLVING AND PYTHON PROGRAMMING UNIT 2 (20)
The document provides an overview of expressions, operators, data types, and control flow statements in Python. It discusses arithmetic, relational, logical, and string expressions. It covers evaluating expressions, operator precedence, implicit and explicit type conversions, and built-in math functions. Control flow statements like if/else, for/while loops, break, continue, and nested loops are explained along with examples. Homework is assigned to write a program to print grades based on marks scored by a student.
The document discusses various topics related to programming in C including data types, constants, expressions, decision making statements, and a sample C program structure. It provides 20 questions with explanations on these topics. It also includes a sample C program to calculate the sum of 10 non-negative numbers entered by the user, illustrating the use of various data types in C programming.
Python uses indentation to define code blocks for decision making statements like if, elif and else. The if statement executes code if a condition is true, elif allows checking multiple conditions, and else runs code if all conditions are false. Loops like while and for repeat code, with while looping until a condition is false and for iterating over a sequence. Nested loops can run inner loops multiple times during outer loop iterations. The else block after a for runs if all iterations complete without breaking from the loop.
This document provides an overview of the Python programming language. It discusses what a program and programming language are, and then describes key features of Python like being simple, interactive, and object-oriented. It explains how to install Python and work in interactive and script modes. The document also covers Python concepts like variables, data types, functions, operators, and control structures like conditional statements and loops.
The document provides an overview of the Python programming language. It discusses features of Python like being simple, easy to learn, versatile, free and open source. It also covers limitations of Python such as being slower than C/C++ for computation heavy tasks. The document describes applications of Python like web development, scientific computing, games development. It then explains basics of Python programming like writing the first program, data types, variables, operators, expressions and lists. Finally, it discusses type conversion and type coercion in Python.
Chapter 9 Conditional and Iterative Statements.pptxXhelalSpahiu
This document provides an overview of conditional and iterative statements in Python. It begins by defining selection and iteration as two types of control structures that allow programs to control the flow of execution.
It then discusses conditional constructs like if/else statements, providing examples of how to write if/else and if/elif/else statements. It also covers loops, specifically while and for loops. The while loop repeats a block of code as long as a condition is true, and for loops iterate over a sequence. Examples are given of using range() and len() with for loops. Finally, the document lists several programming problems suited for different levels that involve conditional and iterative statements.
This document discusses control flow in Python programming. It covers the three types of control flow: sequential, conditional, and iterative execution. Conditional execution uses if, if-else, elif statements to control the flow based on conditions. Iterative execution uses while and for loops to repeatedly execute code. The while loop runs until a condition is false, and the for loop iterates a specific number of times. Break and continue statements can alter the normal flow inside loops. Examples are provided for each control structure. The document concludes with assignments related to control flow concepts in Python.
The document discusses different types of selection statements in C including if, if-else, and switch statements. Relational expressions are used to create conditions for if statements and can be combined using logical operators. An if statement executes a statement if a condition is true, while an if-else statement chooses between two statements depending on the condition. Nested if-else statements and switch statements provide multiway selection. Common errors include misusing assignment versus relational operators and failing to use braces with nested if statements.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlENGWAU TONNY
The document discusses different types of flow control in programming including sequential, selection, and repetition structures. It provides examples of if/else statements, nested ifs, if-else ladders, and the conditional operator. It also covers switch-case statements as an alternative for complex decisions. Finally, it poses challenges for readers to code decision-making structures using if/else and switch-case statements.
The document discusses program statements in Java. It covers:
- The four basic activities of program development: establishing requirements, creating a design, implementing code, and testing.
- Conditional statements like if, if-else, and switch that allow modifying the flow of control through a method.
- Logical operators like && and || that can be used to form complex boolean expressions for conditionals.
The document discusses Python control structures including if-else statements, indentation, and loops. It provides examples of if statements, if-else statements, nested if statements, and elif statements to test conditions and execute code blocks accordingly. It also discusses for loops and the range() function to iterate through sequences and generate number sequences to repeat code. Loops simplify problems by allowing code to repeat without rewriting and help traverse data structures.
The document discusses various Python flow control statements like if/else, while loops, for loops, break and continue. It provides examples and explanations of how each statement works. Key flow control statements covered include if/else for conditional execution, while loops for repetitive execution as long as a condition is true, for loops for executing a block of code a specific number of times, and break/continue for early loop termination or skipping iterations. It also discusses importing modules and functions from the Python standard library.
This document provides an overview of Python programming concepts including what Python is, variables, data types, operators, conditional statements, loops, functions, exceptions, lists, dictionaries, tuples and more. Some key points covered include:
- Python is an interpreted, object-oriented programming language that can be used for many different application types.
- Variables, constants, operators, and control flow structures like conditionals and loops are introduced as the basic building blocks of Python programs.
- Common data types like strings, lists, dictionaries and tuples are described along with their characteristics and functions.
- Other concepts explained are functions, exceptions, formatting, modules and more.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2025/06/state-space-models-vs-transformers-for-ultra-low-power-edge-ai-a-presentation-from-brainchip/
Tony Lewis, Chief Technology Officer at BrainChip, presents the “State-space Models vs. Transformers for Ultra-low-power Edge AI” tutorial at the May 2025 Embedded Vision Summit.
At the embedded edge, choices of language model architectures have profound implications on the ability to meet demanding performance, latency and energy efficiency requirements. In this presentation, Lewis contrasts state-space models (SSMs) with transformers for use in this constrained regime. While transformers rely on a read-write key-value cache, SSMs can be constructed as read-only architectures, enabling the use of novel memory types and reducing power consumption. Furthermore, SSMs require significantly fewer multiply-accumulate units—drastically reducing compute energy and chip area.
New techniques enable distillation-based migration from transformer models such as Llama to SSMs without major performance loss. In latency-sensitive applications, techniques such as precomputing input sequences allow SSMs to achieve sub-100 ms time-to-first-token, enabling real-time interactivity. Lewis presents a detailed side-by-side comparison of these architectures, outlining their trade-offs and opportunities at the extreme edge.
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationChristine Shepherd
AI agents are reshaping logistics and supply chain operations by enabling automation, predictive insights, and real-time decision-making across key functions such as demand forecasting, inventory management, procurement, transportation, and warehouse operations. Powered by technologies like machine learning, NLP, computer vision, and robotic process automation, these agents deliver significant benefits including cost reduction, improved efficiency, greater visibility, and enhanced adaptability to market changes. While practical use cases show measurable gains in areas like dynamic routing and real-time inventory tracking, successful implementation requires careful integration with existing systems, quality data, and strategic scaling. Despite challenges such as data integration and change management, AI agents offer a strong competitive edge, with widespread industry adoption expected by 2025.
Floods in Valencia: Two FME-Powered Stories of Data ResilienceSafe Software
In October 2024, the Spanish region of Valencia faced severe flooding that underscored the critical need for accessible and actionable data. This presentation will explore two innovative use cases where FME facilitated data integration and availability during the crisis. The first case demonstrates how FME was used to process and convert satellite imagery and other geospatial data into formats tailored for rapid analysis by emergency teams. The second case delves into making human mobility data—collected from mobile phone signals—accessible as source-destination matrices, offering key insights into population movements during and after the flooding. These stories highlight how FME's powerful capabilities can bridge the gap between raw data and decision-making, fostering resilience and preparedness in the face of natural disasters. Attendees will gain practical insights into how FME can support crisis management and urban planning in a changing climate.
Domino IQ – What to Expect, First Steps and Use Casespanagenda
Webinar Recording: https://www.panagenda.com/webinars/domino-iq-what-to-expect-first-steps-and-use-cases/
HCL Domino iQ Server – From Ideas Portal to implemented Feature. Discover what it is, what it isn’t, and explore the opportunities and challenges it presents.
Key Takeaways
- What are Large Language Models (LLMs) and how do they relate to Domino iQ
- Essential prerequisites for deploying Domino iQ Server
- Step-by-step instructions on setting up your Domino iQ Server
- Share and discuss thoughts and ideas to maximize the potential of Domino iQ
Bridging the divide: A conversation on tariffs today in the book industry - T...BookNet Canada
A collaboration-focused conversation on the recently imposed US and Canadian tariffs where speakers shared insights into the current legislative landscape, ongoing advocacy efforts, and recommended next steps. This event was presented in partnership with the Book Industry Study Group.
Link to accompanying resource: https://bnctechforum.ca/sessions/bridging-the-divide-a-conversation-on-tariffs-today-in-the-book-industry/
Presented by BookNet Canada and the Book Industry Study Group on May 29, 2025 with support from the Department of Canadian Heritage.
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Anish Kumar
Presented by: Anish Kumar
LinkedIn: https://www.linkedin.com/in/anishkumar/
This lightning talk dives into real-world GenAI projects that scaled from prototype to production using Databricks’ fully managed tools. Facing cost and time constraints, we leveraged four key Databricks features—Workflows, Model Serving, Serverless Compute, and Notebooks—to build an AI inference pipeline processing millions of documents (text and audiobooks).
This approach enables rapid experimentation, easy tuning of GenAI prompts and compute settings, seamless data iteration and efficient quality testing—allowing Data Scientists and Engineers to collaborate effectively. Learn how to design modular, parameterized notebooks that run concurrently, manage dependencies and accelerate AI-driven insights.
Whether you're optimizing AI inference, automating complex data workflows or architecting next-gen serverless AI systems, this session delivers actionable strategies to maximize performance while keeping costs low.
➡ 🌍📱👉COPY & PASTE LINK👉👉👉 ➤ ➤➤ https://drfiles.net/
Wondershare Filmora Crack is a user-friendly video editing software designed for both beginners and experienced users.
PyData - Graph Theory for Multi-Agent Integrationbarqawicloud
Graph theory is a well-known concept for algorithms and can be used to orchestrate the building of multi-model pipelines. By translating tasks and dependencies into a Directed Acyclic Graph, we can orchestrate diverse AI models, including NLP, vision, and recommendation capabilities. This tutorial provides a step-by-step approach to designing graph-based AI model pipelines, focusing on clinical use cases from the field.
Enabling BIM / GIS integrations with Other Systems with FMESafe Software
Jacobs has successfully utilized FME to tackle the complexities of integrating diverse data sources in a confidential $1 billion campus improvement project. The project aimed to create a comprehensive digital twin by merging Building Information Modeling (BIM) data, Construction Operations Building Information Exchange (COBie) data, and various other data sources into a unified Geographic Information System (GIS) platform. The challenge lay in the disparate nature of these data sources, which were siloed and incompatible with each other, hindering efficient data management and decision-making processes.
To address this, Jacobs leveraged FME to automate the extraction, transformation, and loading (ETL) of data between ArcGIS Indoors and IBM Maximo. This process ensured accurate transfer of maintainable asset and work order data, creating a comprehensive 2D and 3D representation of the campus for Facility Management. FME's server capabilities enabled real-time updates and synchronization between ArcGIS Indoors and Maximo, facilitating automatic updates of asset information and work orders. Additionally, Survey123 forms allowed field personnel to capture and submit data directly from their mobile devices, triggering FME workflows via webhooks for real-time data updates. This seamless integration has significantly enhanced data management, improved decision-making processes, and ensured data consistency across the project lifecycle.
If You Use Databricks, You Definitely Need FMESafe Software
DataBricks makes it easy to use Apache Spark. It provides a platform with the potential to analyze and process huge volumes of data. Sounds awesome. The sales brochure reads as if it is a can-do-all data integration platform. Does it replace our beloved FME platform or does it provide opportunities for FME to shine? Challenge accepted
Interested in leveling up your JavaScript skills? Join us for our Introduction to TypeScript workshop.
Learn how TypeScript can improve your code with dynamic typing, better tooling, and cleaner architecture. Whether you're a beginner or have some experience with JavaScript, this session will give you a solid foundation in TypeScript and how to integrate it into your projects.
Workshop content:
- What is TypeScript?
- What is the problem with JavaScript?
- Why TypeScript is the solution
- Coding demo
Trends Artificial Intelligence - Mary MeekerClive Dickens
Mary Meeker’s 2024 AI report highlights a seismic shift in productivity, creativity, and business value driven by generative AI. She charts the rapid adoption of tools like ChatGPT and Midjourney, likening today’s moment to the dawn of the internet. The report emphasizes AI’s impact on knowledge work, software development, and personalized services—while also cautioning about data quality, ethical use, and the human-AI partnership. In short, Meeker sees AI as a transformative force accelerating innovation and redefining how we live and work.
19. 19
For Loop and Range() Function
The range() function is a built-in function in Python that is used to iterate over a sequence of numbers.The
syntax of range() is range(beg, end, [step])
The range() produces a sequence of numbers starting with beg (inclusive) and ending with one less than the
number end.The step argument is option (that is why it is placed in brackets). By default, every number in
the range is incremented by 1 but we can specify a different increment using step. It can be both negative and
positive, but not zero.
Examples: