PHP 7 is the latest big release for PHP, in this session you’ll learn what’s new and what to expect in terms of upgrading your current code work to the new version of PHP.
The document discusses exceptions handling in Java. It begins by defining exceptions as unexpected events that occur during program execution and can terminate a program abnormally. It then discusses Java's exception hierarchy with Throwable at the root, and Error and Exception branches. Errors are irrecoverable while Exceptions can be caught and handled. It provides examples of different exception types like RuntimeException and IOException, and how to handle exceptions using try-catch blocks, the finally block, and throw and throws keywords. Finally, it provides a code example demonstrating try-catch-finally usage.
Errors in Python programs are either syntax errors or exceptions. Syntax errors occur when the code has invalid syntax and exceptions occur when valid code causes an error at runtime. Exceptions can be handled by using try and except blocks. Users can also define their own exceptions by creating exception classes that inherit from the built-in Exception class. The finally block gets executed whether or not an exception was raised and is used to define clean-up actions. The with statement is also used to ensure objects are cleaned up properly after use.
Ruby allows defining reusable blocks of code that can be invoked from methods using the yield statement. A block consists of code enclosed in curly braces and is associated with a method of the same name. The yield statement passes control to the block and can optionally pass parameters to the block. Ruby files can also define BEGIN and END blocks to specify code to run as the file loads and after program execution completes, respectively.
The document outlines the modules of a Java programming course, including Module 03 on control flow and exception handling. Module 03 covers control flow statements like if/else, switch, while, do-while, for; branching statements like break and continue; and exception handling. It provides code examples for each concept and labeled code exercises to practice if/else, switch, for-each loops, break, continue, and handling exceptions.
This document discusses synchronization in multithreaded applications in Java. It covers key concepts like monitors, synchronized methods and statements, and inter-thread communication using wait(), notify(), and notifyAll() methods. Synchronized methods ensure only one thread can access a shared resource at a time by acquiring the object's monitor. synchronized statements allow synchronizing access to non-synchronized methods. Inter-thread communication allows threads to wait for notifications from other threads rather than busy waiting.
The document discusses modern Java constructs introduced after Java 5, including collections, generics, autoboxing, enumerated types, annotations, and how to properly design classes to work with collections. It provides code examples and best practices for using these constructs and highlights resources like Java in a Nutshell and Effective Java for further reading.
This document provides an overview of how to write a basic Java program with a main method that prints output. It includes:
1) An example Java class with a main method that prints "I Rule!" to the console.
2) An explanation that the main method tells the Java Virtual Machine where to start the program and that every Java program needs at least one class and one main method.
3) A discussion of the components of a Java program including classes, methods, and how the main method can contain statements, loops, and conditional branching.
This Java code prompts a user to input their name, student ID number, semester, and major by printing messages to the console. It takes the user input using a BufferedReader and stores each entry in a corresponding string variable - Nama, Nim, Semester, and Jurusan.
Dr. Rajeshree Khande - Java Interactive inputjalinder123
The document discusses reading user input from the keyboard in Java programs. It covers using the BufferedReader and InputStreamReader classes to get user input as a String. It also discusses extracting separate data items from the input String using a StringTokenizer and converting the items to primitive types using wrapper classes. An example is provided that reads numerical data from the keyboard as a String, uses StringTokenizer to separate the items, and wrapper classes to convert to int to calculate and display a result.
Presentation on Template Method Design PatternAsif Tayef
The template method pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. This allows subclasses to redefine certain steps of the algorithm while preserving its overall structure. For example, in a game application, the template method pattern could define a playOneGame method containing the overall game play logic, with abstract methods for game initialization, player turns, and end checking that subclasses implement differently for each specific game like Chess and Monopoly. Hook methods allow subclasses optional control over whether to implement additional template method steps.
The document summarizes the key differences between JUnit 4 and JUnit 5 (alpha). Some of the main changes in JUnit 5 include updated annotations like @Test, support for lambda-based assertions using Hamcrest matchers, assumptions and exception testing capabilities, and support for nested and parameterized tests. JUnit 5 also overhauls extension mechanisms and introduces extension points for customization. While still in development, JUnit 5 is moving to an API based on extensions and customization points rather than the runner approach used in JUnit 4.
chap4 ; Flow Control, Assertions, and Exception Handling (scjp/ocjp)It Academy
The document discusses different types of loops in Java including while, do-while, for, and enhanced for loops. It explains the syntax and usage of each loop type with examples. Key loop concepts covered include boolean expressions for conditions, loop variables, continue and break statements. The document also discusses if/else and switch conditional statements in Java.
The document discusses the StringTokenizer class in Java, which is used to break a string into tokens. It provides three examples of how StringTokenizer can be used: [1] to print each token in a string; [2] to calculate the average of grades entered on one line; and [3] to display student IDs, number of quizzes taken, and average from a file with IDs and grades. The key StringTokenizer methods like hasMoreTokens(), nextToken(), and countTokens() are also overviewed.
The document discusses different types of looping statements in VB.NET, including While, Do, For, and For Each loops. It provides examples and syntax for each type of loop. The key types of loops are:
- While loops repeat statements as long as a condition is true.
- Do loops execute statements first, then check a condition to repeat.
- For loops repeat a set number of times, specified by a start and end value.
- For Each loops iterate through each element of a collection, such as an array.
The Interpreter design pattern allows defining a representation for a grammar and an interpreter that uses the representation to interpret sentences in a language. It defines interfaces for terminal and nonterminal expressions and an interpreter context. Terminal expressions interpret terminal tokens while nonterminal expressions interpret nonterminal expressions. The context contains global information used during parsing and interpretation. The pattern is useful for implementing rule engines and adding functionality to composite pattern implementations. It allows embedding domain-specific languages in programs and simplifies changing and extending grammars.
basic of desicion control statement in pythonnitamhaske
it consists if-else, nested if, if-elif-else, for loop, while loop with flowchart and examples. also continue ,pass and break statement.
and else with for and while loop
This document discusses various decision statements in VB.NET including If-Then, If-Then Else, If-Then ElseIf, and Select Case statements. It provides examples of each statement type and discusses how to nest statements and use short-circuited logic. Key features covered include using multiple conditions in If-Then ElseIf, matching expressions in Select Case, and nesting Select Case statements within other control structures.
Most developers are aware about design patterns. The difficulty is not in understanding them but in getting an intuitive understanding of when and how to apply them. In this session, we'll go through a case study of how a tiny interpreter (of course written in Java) may implement different design patterns.
The link to source code is:
https://github.com/CodeOpsTech/InterpreterDesignPatterns
This document discusses loop control statements in VB.NET, including exit, continue, and goto statements. The exit statement terminates the loop and transfers control to the statement after the loop. The continue statement skips the rest of the current loop iteration and continues to the next one. The goto statement unconditionally transfers control to a labeled statement. Examples are provided for each type of statement.
Python Session - 3
Escape Sequence
Data Types
Conversion between data types
Operators
Python Numbers
Python List
Python Tuple
Python Strings
Python Set
Python Dictionary
This document discusses using the Scanner class in Java to take user input from the console. It explains the different Scanner methods like nextInt(), nextDouble(), etc. for reading different data types. It provides examples of programs that take user input, perform calculations, and output results. It also includes exercises for students to practice writing programs that take multiple user inputs and perform operations like addition, multiplication, averaging marks, and calculating area and volume using user-provided values.
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
This document discusses conditional statements and switch statements in C#. It explains the syntax and usage of if, else, else if, and ternary conditional statements. It also covers the syntax and purpose of switch statements, including the break and default keywords. Code examples are provided to demonstrate how to use if/else, else if, ternary operators, and switch statements to conditionally execute blocks of code based on simple logic checks and comparisons of variables.
The document provides an overview of various control statements in Java including if/else statements, switch statements, loops (for, while, do-while), break, continue statements, and nested loops. It includes code examples to demonstrate how to use each control structure and discusses variations like nested if/switch statements, empty loops, and declaring loop variables inside the for statement.
This document provides an overview of Python's if-else conditional statements and loops. It discusses the syntax of if statements, elif (else if), else, conditional expressions, nested if statements, and while loops. Examples are given to demonstrate how to use basic conditional logic and loops to control program flow in Python. Key topics covered include using logical operators like ==, !=, <, > to define conditions, the importance of indentation, and how else clauses work with if and while statements.
This document discusses compound statements, control flow statements, and loops in Python. It begins by defining compound statements as groups of statements executed as a unit with specific patterns. It then explains the different types of control flow statements - sequence, selection, and iteration. Sequence refers to statements executed sequentially, selection allows execution based on conditions, and iteration repeats statements. The document discusses if, if-else, and nested if statements for selection. It also covers while and for loops for iteration. Finally, it briefly mentions the continue and break statements that can be used within loops to skip iterations or exit loops early.
This document provides information on Python code structures, including if/else statements, loops (while and for), functions, and arguments. It explains the basic syntax and usage of these structures. Key points covered include:
- How to write if/else statements and the use of conditions like ==, !=, <, >, etc.
- The syntax of while and for loops, and how to use break, continue, else blocks
- What functions are in Python and how to define them with def, pass arguments, and return values
- The basics of calling functions, optional arguments, and nested structures like if/else in loops
This Java code prompts a user to input their name, student ID number, semester, and major by printing messages to the console. It takes the user input using a BufferedReader and stores each entry in a corresponding string variable - Nama, Nim, Semester, and Jurusan.
Dr. Rajeshree Khande - Java Interactive inputjalinder123
The document discusses reading user input from the keyboard in Java programs. It covers using the BufferedReader and InputStreamReader classes to get user input as a String. It also discusses extracting separate data items from the input String using a StringTokenizer and converting the items to primitive types using wrapper classes. An example is provided that reads numerical data from the keyboard as a String, uses StringTokenizer to separate the items, and wrapper classes to convert to int to calculate and display a result.
Presentation on Template Method Design PatternAsif Tayef
The template method pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. This allows subclasses to redefine certain steps of the algorithm while preserving its overall structure. For example, in a game application, the template method pattern could define a playOneGame method containing the overall game play logic, with abstract methods for game initialization, player turns, and end checking that subclasses implement differently for each specific game like Chess and Monopoly. Hook methods allow subclasses optional control over whether to implement additional template method steps.
The document summarizes the key differences between JUnit 4 and JUnit 5 (alpha). Some of the main changes in JUnit 5 include updated annotations like @Test, support for lambda-based assertions using Hamcrest matchers, assumptions and exception testing capabilities, and support for nested and parameterized tests. JUnit 5 also overhauls extension mechanisms and introduces extension points for customization. While still in development, JUnit 5 is moving to an API based on extensions and customization points rather than the runner approach used in JUnit 4.
chap4 ; Flow Control, Assertions, and Exception Handling (scjp/ocjp)It Academy
The document discusses different types of loops in Java including while, do-while, for, and enhanced for loops. It explains the syntax and usage of each loop type with examples. Key loop concepts covered include boolean expressions for conditions, loop variables, continue and break statements. The document also discusses if/else and switch conditional statements in Java.
The document discusses the StringTokenizer class in Java, which is used to break a string into tokens. It provides three examples of how StringTokenizer can be used: [1] to print each token in a string; [2] to calculate the average of grades entered on one line; and [3] to display student IDs, number of quizzes taken, and average from a file with IDs and grades. The key StringTokenizer methods like hasMoreTokens(), nextToken(), and countTokens() are also overviewed.
The document discusses different types of looping statements in VB.NET, including While, Do, For, and For Each loops. It provides examples and syntax for each type of loop. The key types of loops are:
- While loops repeat statements as long as a condition is true.
- Do loops execute statements first, then check a condition to repeat.
- For loops repeat a set number of times, specified by a start and end value.
- For Each loops iterate through each element of a collection, such as an array.
The Interpreter design pattern allows defining a representation for a grammar and an interpreter that uses the representation to interpret sentences in a language. It defines interfaces for terminal and nonterminal expressions and an interpreter context. Terminal expressions interpret terminal tokens while nonterminal expressions interpret nonterminal expressions. The context contains global information used during parsing and interpretation. The pattern is useful for implementing rule engines and adding functionality to composite pattern implementations. It allows embedding domain-specific languages in programs and simplifies changing and extending grammars.
basic of desicion control statement in pythonnitamhaske
it consists if-else, nested if, if-elif-else, for loop, while loop with flowchart and examples. also continue ,pass and break statement.
and else with for and while loop
This document discusses various decision statements in VB.NET including If-Then, If-Then Else, If-Then ElseIf, and Select Case statements. It provides examples of each statement type and discusses how to nest statements and use short-circuited logic. Key features covered include using multiple conditions in If-Then ElseIf, matching expressions in Select Case, and nesting Select Case statements within other control structures.
Most developers are aware about design patterns. The difficulty is not in understanding them but in getting an intuitive understanding of when and how to apply them. In this session, we'll go through a case study of how a tiny interpreter (of course written in Java) may implement different design patterns.
The link to source code is:
https://github.com/CodeOpsTech/InterpreterDesignPatterns
This document discusses loop control statements in VB.NET, including exit, continue, and goto statements. The exit statement terminates the loop and transfers control to the statement after the loop. The continue statement skips the rest of the current loop iteration and continues to the next one. The goto statement unconditionally transfers control to a labeled statement. Examples are provided for each type of statement.
Python Session - 3
Escape Sequence
Data Types
Conversion between data types
Operators
Python Numbers
Python List
Python Tuple
Python Strings
Python Set
Python Dictionary
This document discusses using the Scanner class in Java to take user input from the console. It explains the different Scanner methods like nextInt(), nextDouble(), etc. for reading different data types. It provides examples of programs that take user input, perform calculations, and output results. It also includes exercises for students to practice writing programs that take multiple user inputs and perform operations like addition, multiplication, averaging marks, and calculating area and volume using user-provided values.
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
This document discusses conditional statements and switch statements in C#. It explains the syntax and usage of if, else, else if, and ternary conditional statements. It also covers the syntax and purpose of switch statements, including the break and default keywords. Code examples are provided to demonstrate how to use if/else, else if, ternary operators, and switch statements to conditionally execute blocks of code based on simple logic checks and comparisons of variables.
The document provides an overview of various control statements in Java including if/else statements, switch statements, loops (for, while, do-while), break, continue statements, and nested loops. It includes code examples to demonstrate how to use each control structure and discusses variations like nested if/switch statements, empty loops, and declaring loop variables inside the for statement.
This document provides an overview of Python's if-else conditional statements and loops. It discusses the syntax of if statements, elif (else if), else, conditional expressions, nested if statements, and while loops. Examples are given to demonstrate how to use basic conditional logic and loops to control program flow in Python. Key topics covered include using logical operators like ==, !=, <, > to define conditions, the importance of indentation, and how else clauses work with if and while statements.
This document discusses compound statements, control flow statements, and loops in Python. It begins by defining compound statements as groups of statements executed as a unit with specific patterns. It then explains the different types of control flow statements - sequence, selection, and iteration. Sequence refers to statements executed sequentially, selection allows execution based on conditions, and iteration repeats statements. The document discusses if, if-else, and nested if statements for selection. It also covers while and for loops for iteration. Finally, it briefly mentions the continue and break statements that can be used within loops to skip iterations or exit loops early.
This document provides information on Python code structures, including if/else statements, loops (while and for), functions, and arguments. It explains the basic syntax and usage of these structures. Key points covered include:
- How to write if/else statements and the use of conditions like ==, !=, <, >, etc.
- The syntax of while and for loops, and how to use break, continue, else blocks
- What functions are in Python and how to define them with def, pass arguments, and return values
- The basics of calling functions, optional arguments, and nested structures like if/else in loops
Introduction to Python for Data Science and Machine Learning ParrotAI
This document provides an introduction and overview of Python for data science and machine learning. It covers basics of Python including what Python is, its features, why it is useful for data science. It also discusses installing Python, using the IDLE and Jupyter Notebook environments. The document then covers Python basics like variables, data types, operators, decision making and loops. Finally, it discusses collection data types like lists, tuples and dictionaries and functions in Python.
Python is an open-source, object-oriented programming language created by Guido van Rossum in 1991. It is designed to be highly readable and easy to implement. Python scripts can be run immediately without compilation. Major uses of Python include system utilities, web development, graphical user interfaces, and database programming.
This document provides an introduction to the Python programming language. It covers Python's basic data types like integers, floats, strings and lists. It also discusses functions, conditionals, loops, modules and libraries. Example code is provided to demonstrate Python syntax for variables, arithmetic, string operations, conditionals, functions and more. Key aspects of Python like dynamic typing, indentation, comments and documentation strings are also explained.
This document provides an introduction and overview of the Python programming language. It describes Python as a general-purpose, object-oriented programming language with features like high-level programming capabilities, an easily understandable syntax, portability, and being easy to learn. It then discusses Python's characteristics like being an interpreted language, supporting object-oriented programming, being interactive and easy to use, having straightforward syntax, being portable, extendable, and scalable. The document also outlines some common uses of Python like for creating web and desktop applications, and provides examples of using Python's interactive and script modes.
Helpmeinhomework Experts provides the most trusted and reliable online Programming assignment help . Programming is one of the most widely taught subjects across the universities. The complexity of subjects make students seek for quality and affordable online guidance. We at helpmeinhomework.com Experts cater to such needs of the students. Our programming experts provide assignment help to students across UK, USA and Australia for multiple programming languages i.e. Java, Python, HTML, PHP, Assembly language, C ,Linux ,Unix etc.
This document provides an overview of key concepts in programming and Python. It defines terms like code, syntax, output, console, compiling, interpreting, and variables. It explains Python as an interpreted language and shows examples of printing output, taking user input, performing calculations with numbers and math commands, using variables, and basic control structures like if/else and loops. It also covers data types like integers, floats, strings, lists, and how to modify and format them.
The document provides an introduction to programming with Python. It discusses key concepts like code, syntax, output, and consoles. It also covers compiling vs interpreting languages, with Python being an interpreted language. The document explains expressions, variables, basic math operations, and functions in Python like print and input. It introduces control structures like if/else statements, for loops, and while loops. It also covers different data types in Python including numbers, strings, lists, and dictionaries.
The document provides an introduction to programming with Python. It discusses key concepts like code, syntax, output, and consoles. It also covers compiling vs interpreting languages, with Python being an interpreted language. The document explains expressions, variables, basic math operations, and functions in Python like print and input. It introduces control structures like if/else statements and for/while loops. It also covers different data types in Python including numbers, strings, lists, and dictionaries.
Python is an interpreted programming language that can be used to perform calculations, handle text, and control program flow. It allows variables to store values that can later be used in expressions. Common operations include arithmetic, printing output, accepting user input, and repeating tasks using for loops and conditional statements like if/else. The interpreter executes Python code directly without a separate compilation step required by other languages.
The document provides an introduction to programming in Python. It discusses how Python can be used for web development, desktop applications, data science, machine learning, and more. It also covers executing Python programs, reading keyboard input, decision making and loops in Python, standard data types like numbers, strings, lists, tuples and dictionaries. Additionally, it describes functions, opening and reading/writing files, regular expressions, and provides examples of SQLite database connections in Python projects.
Python is a general purpose programming language that can be used for both programming and scripting. It was created in the 1990s by Guido van Rossum. Python is an interpreted language that is free, powerful, and portable. It can be used for tasks like web development, data analysis, and system scripting. The document provides an overview of Python including its history, uses, data types like strings and lists, and basic programming concepts like variables, conditionals, and loops. It recommends Python as a principal teaching language due to its free and easy installation, flexibility, use in academia and industry, and ability to offer a more rapid and enjoyable learning experience for students.
RaspberryPi & Python Workshop Day - 02.pptxShivanshSeth6
The workshop covered topics on Python programming including basics of Python, loops, conditionals, modules and importing libraries. It also covered the Matplotlib library, Linux commands, and building projects including a password manager and PDF password encrypter. Specific topics on loops included while and for loops. Conditionals covered if, if-else, and nested if statements. Modules allow organizing related code and accessing functions. Matplotlib is a data visualization library and Linux commands were demonstrated for file/folder management.
Python is a general purpose programming language that can be used for both programming and scripting. It is an interpreted language, meaning code is executed line by line by the Python interpreter. Python code is written in plain text files with a .py extension. Key features of Python include being object-oriented, using indentation for code blocks rather than brackets, and having a large standard library. Python code can be used for tasks like system scripting, web development, data analysis, and more.
How to Manage Maintenance Request in Odoo 18Celine George
Efficient maintenance management is crucial for keeping equipment and work centers running smoothly in any business. Odoo 18 provides a Maintenance module that helps track, schedule, and manage maintenance requests efficiently.
How to Manage & Create a New Department in Odoo 18 EmployeeCeline George
In Odoo 18's Employee module, organizing your workforce into departments enhances management and reporting efficiency. Departments are a crucial organizational unit within the Employee module.
Slides from a Capitol Technology University presentation covering doctoral programs offered by the university. All programs are online, and regionally accredited. The presentation covers degree program details, tuition, financial aid and the application process.
How to Create an Event in Odoo 18 - Odoo 18 SlidesCeline George
Creating an event in Odoo 18 is a straightforward process that allows you to manage various aspects of your event efficiently.
Odoo 18 Events Module is a powerful tool for organizing and managing events of all sizes, from conferences and workshops to webinars and meetups.
This presentation was provided by Nicole 'Nici" Pfeiffer of the Center for Open Science (COS), during the first session of our 2025 NISO training series "Secrets to Changing Behavior in Scholarly Communications." Session One was held June 5, 2025.
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecdrazelitouali
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Human Anatomy and Physiology II Unit 3 B pharm Sem 2
Respiratory system
Anatomy of respiratory system with special reference to anatomy
of lungs, mechanism of respiration, regulation of respiration
Lung Volumes and capacities transport of respiratory gases,
artificial respiration, and resuscitation methods
Urinary system
Anatomy of urinary tract with special reference to anatomy of
kidney and nephrons, functions of kidney and urinary tract,
physiology of urine formation, micturition reflex and role of
kidneys in acid base balance, role of RAS in kidney and
disorders of kidney
Strengthened Senior High School - Landas Tool Kit.pptxSteffMusniQuiballo
Landas Tool Kit is a very helpful guide in guiding the Senior High School students on their SHS academic journey. It will pave the way on what curriculum exits will they choose and fit in.
RE-LIVE THE EUPHORIA!!!!
The Quiz club of PSGCAS brings to you a fun-filled breezy general quiz set from numismatics to sports to pop culture.
Re-live the Euphoria!!!
QM: Eiraiezhil R K,
BA Economics (2022-25),
The Quiz club of PSGCAS
Adam Grant: Transforming Work Culture Through Organizational PsychologyPrachi Shah
This presentation explores the groundbreaking work of Adam Grant, renowned organizational psychologist and bestselling author. It highlights his key theories on giving, motivation, leadership, and workplace dynamics that have revolutionized how organizations think about productivity, collaboration, and employee well-being. Ideal for students, HR professionals, and leadership enthusiasts, this deck includes insights from his major works like Give and Take, Originals, and Think Again, along with interactive elements for enhanced engagement.
Different pricelists for different shops in odoo Point of Sale in Odoo 17Celine George
Price lists are a useful tool for managing the costs of your goods and services. This can assist you in working with other businesses effectively and maximizing your revenues. Additionally, you can provide your customers discounts by using price lists.
4. Python is pre-installed on most Unix systems,
including Linux and MAC OS X
The pre-installed version may not be the
most recent one (2.6.2 and 3.1.1 as of Sept
09)
Download from http://python.org/download/
Python provides two options
IDLE
Command Line Interpreter
12. Indentation matters to code meaning
◦ Block structure indicated by indentation
First assignment to a variable creates it
◦ Variable types don’t need to be declared.
◦ Python figures out the variable types on its own.
Assignment operator is = and comparison
operator is ==
13. For numbers + , - , * , / , % are as
expected
◦ Special use of + for string concatenation
Logical operators are words (and, or,
not) not symbols
The basic printing command is print
14. You can assign values to multiple variable at
the same time
>>> x, y = 2, 3
>>> x
2
>>> y
3
This makes it easy to swap values
>>> x, y = y, x
Assignments can be chained
>>> a = b = x = 2
15. The main statement used for selecting from
alternative actions based on test results
It’s the primary selection tool in Python and
represents the Logic process
17. Simple If statement
if 4>3:
print (“it is true that 4>3”)
if a==1:
print (“true” )
a=10
if a==10:
print (“a=10”)
18. If Statement “login” example
password=‘coolguru ‘
If password== input(“Enter your password :”):
print(“You have logged in” )
19. If... else statement
It takes the form of an if test, and
ends with an optional else block
if <test>:
<statement1>
else:
<statement2>
20. If Statement “login” example
password=‘coolguru ‘
If password== input(“Enter your password :”):
print(“You have logged in” )
else:
print(“ invalid password “)
21. If… else if … else statement
It takes the form of an if test, followed by
one or more optional elif tests, and ends
with an optional else block
if <test1>:
<statement1>
elif <test2>:
<statement2>
else:
<statement3>
22. If… else if … else statement
example
number = 23
guess = int(input('Enter an integer : '))
if guess == number:
print ( 'Congratulations, you guessed it.‘)
print ("(but you do not win any prizes!)“)
elif guess < number:
print ('No, it is a little higher than that' )
else:
print ('No, it is a little lower than that‘)
23. Console applications
Enterprise applications
Web applications
Mobile applications
Office applications
24. Used for Scripting.
Developing games.
Graphics and Animation
Google search engine & Youtube
Yahoo maps
Financial applications