1) The document discusses various Python flow control statements including if, if-else, nested if-else, and elif statements with examples of using these to check conditions and execute code blocks accordingly.
2) Examples include programs to check number comparisons, even/odd numbers, positive/negative numbers, and using nested if-else for multi-level checks like checking triangle validity.
3) The last few sections discuss using if-else statements to classify triangles as equilateral, isosceles, or scalene and to check if a number is positive, negative, or zero.
This document discusses values, data types, and the five standard data types in Python. It defines that values are the fundamental things like numbers and strings that programs manipulate. Data type refers to the type and size of data that variables can hold. The five main data types in Python are numbers, strings, lists, tuples, and dictionaries. Numbers include integers, floating point values, and complex numbers. Lists and tuples are ordered sequences that can hold heterogeneous data, but lists are mutable while tuples are immutable. Strings are ordered sequences of characters. Dictionaries are unordered collections of key-value pairs.
What are Data structures in Python? | List, Dictionary, Tuple Explained | Edu...Edureka!
YouTube Link: https://youtu.be/m9n2f9lhtrw
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka video on 'Data Structures in Python' will help you understand the various data structures that Python has built into itself such as the list, dictionary, tuple and more. Further, we will also understand stacks, queues, trees and how they are implemented in Python using classes and functions. The video is divided into the following parts:
What are Data Structures?
Why are Data Structures needed?
Types of Data Structures in Python
Built-In Data Structures
Lists
Dictionary
Tuple
Sets
User-Defined Data Structure
Array
Stack
Queue
Linked List
Tree
Graph
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This document provides an overview of problem solving and Python programming. It discusses computational thinking and problem solving, including identifying computational problems, algorithms, building blocks of algorithms, and illustrative problems. It also discusses algorithmic problem solving techniques like iteration and recursion. Finally, it briefly introduces the course titled "GE8151-PROBLEM SOLVING AND PYTHON PROGRAMMING".
Python was invented in 1991 by Guido Van Rossum as a general purpose, high-level programming language. It is commonly used for web programming, scripting, scientific computing, and artificial intelligence. Python is easy to learn, portable, has extensive libraries, and is open source and free. It can be used interactively through the Python interpreter or IDE and for various applications like games, web development, and app development.
This document discusses key concepts in Python programming including data types, operators, strings, modules, object-oriented programming, and connecting to SQLite databases. It provides examples of numeric, boolean, and sequence data types. It also demonstrates various math operators, string operators like concatenation and multiplication, and how to import and use modules. Object-oriented concepts like classes, attributes, and behaviors are explained using a parrot example. Finally, it mentions how to connect a SQLite database to Python code using the MySQLdb interface.
The document discusses Python programming concepts such as data types, variables, operators, and input/output. It provides examples of Python code and explains key features like:
- Python supports several data types including integers, floats, booleans, strings, and lists.
- Variables store and label values that can be of different data types. Variables are created using names.
- Operators like arithmetic, comparison, and logical operators are used to manipulate values.
- User input and output is handled through functions like print() and input().
- Comments, indentation, and quotation are syntax elements in Python code.
This document provides an introduction to the Python programming language. It discusses Python's design philosophy emphasizing readability. It also covers printing messages, reading input, variables and data types, operators, and basic syntax like comments and identifiers. Arithmetic, relational, logical and bitwise operators are explained along with examples.
The document discusses different types of conditional and control statements in Python including if, if-else, elif, nested if-else, while, for loops, and else with loops.
It provides the syntax and examples of each statement type. The if statement and if-else statement are used for simple decision making. The elif statement allows for chained conditional execution with more than two possibilities. Nested if-else allows if/elif/else statements within other conditionals. While and for loops are used to repeatedly execute blocks of code, with while looping until a condition is false and for looping over sequences. The else statement with loops executes code when the loop condition is false.
Files in Python represent sequences of bytes stored on disk for permanent storage. They can be opened in different modes like read, write, append etc using the open() function, which returns a file object. Common file operations include writing, reading, seeking to specific locations, and closing the file. The with statement is recommended for opening and closing files to ensure they are properly closed even if an exception occurs.
In this module of python programming you will be learning about control statements. A control statement is a statement that determines whether other statements will be executed. An if statement decides whether to execute another statement, or decides which of two statements to execute. A loop decides how many times to execute another statement.
Lists in Python allow storing and manipulating multiple items in a single variable. They can contain elements of different data types like strings, integers, and booleans. Lists can be accessed using indexes, sorted, copied, and joined. Common list methods include append(), insert(), remove(), pop(), sort(), and reverse() to add, remove, and rearrange list elements.
The document discusses various Python flow control statements including if/else, for loops, while loops, break and continue. It provides examples of using if/else statements for decision making and checking conditions. It also demonstrates how to use for and while loops for iteration, including using the range function. It explains how break and continue can be used to terminate or skip iterations. Finally, it briefly mentions pass, for, while loops with else blocks, and nested loops.
METHODS DESCRIPTION
copy() They copy() method returns a shallow copy of the dictionary.
clear() The clear() method removes all items from the dictionary.
pop() Removes and returns an element from a dictionary having the given key.
popitem() Removes the arbitrary key-value pair from the dictionary and returns it as tuple.
get() It is a conventional method to access a value for a key.
dictionary_name.values() returns a list of all the values available in a given dictionary.
str() Produces a printable string representation of a dictionary.
update() Adds dictionary dict2’s key-values pairs to dict
setdefault() Set dict[key]=default if key is not already in dict
keys() Returns list of dictionary dict’s keys
items() Returns a list of dict’s (key, value) tuple pairs
has_key() Returns true if key in dictionary dict, false otherwise
fromkeys() Create a new dictionary with keys from seq and values set to value.
type() Returns the type of the passed variable.
cmp() Compares elements of both dict.
The document discusses various Python datatypes. It explains that Python supports built-in and user-defined datatypes. The main built-in datatypes are None, numeric, sequence, set and mapping types. Numeric types include int, float and complex. Common sequence types are str, bytes, list, tuple and range. Sets can be created using set and frozenset datatypes. Mapping types represent a group of key-value pairs like dictionaries.
Regular expressions are a powerful tool for searching, matching, and parsing text patterns. They allow complex text patterns to be matched with a standardized syntax. All modern programming languages include regular expression libraries. Regular expressions can be used to search strings, replace parts of strings, split strings, and find all occurrences of a pattern in a string. They are useful for tasks like validating formats, parsing text, and finding/replacing text. This document provides examples of common regular expression patterns and methods for using regular expressions in Python.
This document discusses input and output in C++. It explains that C++ uses stream classes to implement input/output operations with the console and disk files. It describes the different stream classes like istream, ostream, and iostream. It discusses unformatted I/O functions like cin, cout, get(), put(), getline(), and write() for console input/output. It also covers formatted I/O functions like width(), precision(), fill(), and setf() to control formatting of output.
Functions allow programmers to organize code into reusable blocks. A function is defined using the def keyword and can accept parameters. The body of a function contains a set of statements that run when the function is called. Functions can return values and allow code to be reused, reducing errors and improving readability. Parameters allow information to be passed into functions, while return values allow functions to provide results.
The document discusses inline functions in C++. Inline functions allow code from a function to be pasted directly into the call site rather than executing a function call. This avoids overhead from calling and returning from functions. Good candidates for inline are small, simple functions called frequently. The document provides an example of a function defined with the inline keyword and the optimizations a compiler may perform after inlining. It also compares inline functions to macros and discusses where inline functions are best used.
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Edureka!
This document discusses loops in Python. It begins by explaining why loops are useful, such as for payroll processing to calculate salaries and bonuses for multiple employees. It then defines loops as allowing code to execute repeatedly based on conditional statements. The document outlines the main types of loops in Python - while loops, for loops, and nested loops. While loops iterate until a condition is false, for loops iterate a specified number of times, and nested loops involve loops within other loops. Examples are provided for each loop type, such as a guessing game to demonstrate a while loop and calculating factorials with a for loop.
This document summarizes various control statements in Python including if, if-else, if-elif-else statements, while and for loops, break, continue, pass, assert, and return statements. It provides the syntax and examples for each statement type. Control statements allow changing the flow of execution in a Python program. Key statements include if/else for conditional execution, while/for loops for repetitive execution, and break/continue to exit/skip iterations.
The document discusses different types of loops in C#: while loops, do loops, for loops, and foreach loops. It provides examples of how each loop works and when each would be used. The while loop and do loop execute code while/until a condition is met. The for loop is used when the number of iterations is known. The foreach loop iterates over collections and is simpler than other loops for that purpose.
The document discusses various window controls in C# .NET including message boxes, forms, buttons, labels, text boxes, check boxes, radio buttons, date/time pickers, progress bars, and dialog boxes. It provides details on how to use each control, its purpose, and relevant properties.
Looping Statements and Control Statements in PythonPriyankaC44
This document discusses looping statements and control statements in Python. It explains while loops, for loops, and the use of break, continue, else and pass statements. Some key points:
- While loops repeatedly execute statements as long as a condition is true. For loops iterate over a sequence.
- Break and continue statements can alter loop flow - break exits the entire loop, continue skips to the next iteration.
- The else block in loops runs when the condition becomes false (while) or the sequence is complete (for).
- Pass is a null operation used when syntax requires a statement but no operation is needed.
Several examples of loops and control statements are provided to demonstrate their usage.
Youtube Link: https://youtu.be/woVJ4N5nl_s
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka PPT on 'Python Basics' will help you understand what exactly makes Python special and covers all the basics of Python programming along with examples.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This lecture covers data structures and iteration. It discusses arrays as ordered collections of values that allow items to be accessed by index. Python offers two array-like data structures: lists, which are mutable, and tuples, which are immutable. Loops allow code to repeatedly execute and come in two main types - while loops, which repeat while a condition is true, and for loops. Break and continue statements can be used in loops to exit or skip iterations under certain conditions.
This document discusses control flow, functions, and recursion in Python. It begins by defining boolean expressions and explaining different types of operators like arithmetic, relational, logical, and assignment operators. It then covers conditional execution using if, else, and elif statements. Loops like while and for are explained along with break, continue, and pass statements. Functions are described as being able to return values. Finally, recursion is defined as a function calling itself, either directly or indirectly.
The document discusses different types of conditional and control statements in Python including if, if-else, elif, nested if-else, while, for loops, and else with loops.
It provides the syntax and examples of each statement type. The if statement and if-else statement are used for simple decision making. The elif statement allows for chained conditional execution with more than two possibilities. Nested if-else allows if/elif/else statements within other conditionals. While and for loops are used to repeatedly execute blocks of code, with while looping until a condition is false and for looping over sequences. The else statement with loops executes code when the loop condition is false.
Files in Python represent sequences of bytes stored on disk for permanent storage. They can be opened in different modes like read, write, append etc using the open() function, which returns a file object. Common file operations include writing, reading, seeking to specific locations, and closing the file. The with statement is recommended for opening and closing files to ensure they are properly closed even if an exception occurs.
In this module of python programming you will be learning about control statements. A control statement is a statement that determines whether other statements will be executed. An if statement decides whether to execute another statement, or decides which of two statements to execute. A loop decides how many times to execute another statement.
Lists in Python allow storing and manipulating multiple items in a single variable. They can contain elements of different data types like strings, integers, and booleans. Lists can be accessed using indexes, sorted, copied, and joined. Common list methods include append(), insert(), remove(), pop(), sort(), and reverse() to add, remove, and rearrange list elements.
The document discusses various Python flow control statements including if/else, for loops, while loops, break and continue. It provides examples of using if/else statements for decision making and checking conditions. It also demonstrates how to use for and while loops for iteration, including using the range function. It explains how break and continue can be used to terminate or skip iterations. Finally, it briefly mentions pass, for, while loops with else blocks, and nested loops.
METHODS DESCRIPTION
copy() They copy() method returns a shallow copy of the dictionary.
clear() The clear() method removes all items from the dictionary.
pop() Removes and returns an element from a dictionary having the given key.
popitem() Removes the arbitrary key-value pair from the dictionary and returns it as tuple.
get() It is a conventional method to access a value for a key.
dictionary_name.values() returns a list of all the values available in a given dictionary.
str() Produces a printable string representation of a dictionary.
update() Adds dictionary dict2’s key-values pairs to dict
setdefault() Set dict[key]=default if key is not already in dict
keys() Returns list of dictionary dict’s keys
items() Returns a list of dict’s (key, value) tuple pairs
has_key() Returns true if key in dictionary dict, false otherwise
fromkeys() Create a new dictionary with keys from seq and values set to value.
type() Returns the type of the passed variable.
cmp() Compares elements of both dict.
The document discusses various Python datatypes. It explains that Python supports built-in and user-defined datatypes. The main built-in datatypes are None, numeric, sequence, set and mapping types. Numeric types include int, float and complex. Common sequence types are str, bytes, list, tuple and range. Sets can be created using set and frozenset datatypes. Mapping types represent a group of key-value pairs like dictionaries.
Regular expressions are a powerful tool for searching, matching, and parsing text patterns. They allow complex text patterns to be matched with a standardized syntax. All modern programming languages include regular expression libraries. Regular expressions can be used to search strings, replace parts of strings, split strings, and find all occurrences of a pattern in a string. They are useful for tasks like validating formats, parsing text, and finding/replacing text. This document provides examples of common regular expression patterns and methods for using regular expressions in Python.
This document discusses input and output in C++. It explains that C++ uses stream classes to implement input/output operations with the console and disk files. It describes the different stream classes like istream, ostream, and iostream. It discusses unformatted I/O functions like cin, cout, get(), put(), getline(), and write() for console input/output. It also covers formatted I/O functions like width(), precision(), fill(), and setf() to control formatting of output.
Functions allow programmers to organize code into reusable blocks. A function is defined using the def keyword and can accept parameters. The body of a function contains a set of statements that run when the function is called. Functions can return values and allow code to be reused, reducing errors and improving readability. Parameters allow information to be passed into functions, while return values allow functions to provide results.
The document discusses inline functions in C++. Inline functions allow code from a function to be pasted directly into the call site rather than executing a function call. This avoids overhead from calling and returning from functions. Good candidates for inline are small, simple functions called frequently. The document provides an example of a function defined with the inline keyword and the optimizations a compiler may perform after inlining. It also compares inline functions to macros and discusses where inline functions are best used.
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Edureka!
This document discusses loops in Python. It begins by explaining why loops are useful, such as for payroll processing to calculate salaries and bonuses for multiple employees. It then defines loops as allowing code to execute repeatedly based on conditional statements. The document outlines the main types of loops in Python - while loops, for loops, and nested loops. While loops iterate until a condition is false, for loops iterate a specified number of times, and nested loops involve loops within other loops. Examples are provided for each loop type, such as a guessing game to demonstrate a while loop and calculating factorials with a for loop.
This document summarizes various control statements in Python including if, if-else, if-elif-else statements, while and for loops, break, continue, pass, assert, and return statements. It provides the syntax and examples for each statement type. Control statements allow changing the flow of execution in a Python program. Key statements include if/else for conditional execution, while/for loops for repetitive execution, and break/continue to exit/skip iterations.
The document discusses different types of loops in C#: while loops, do loops, for loops, and foreach loops. It provides examples of how each loop works and when each would be used. The while loop and do loop execute code while/until a condition is met. The for loop is used when the number of iterations is known. The foreach loop iterates over collections and is simpler than other loops for that purpose.
The document discusses various window controls in C# .NET including message boxes, forms, buttons, labels, text boxes, check boxes, radio buttons, date/time pickers, progress bars, and dialog boxes. It provides details on how to use each control, its purpose, and relevant properties.
Looping Statements and Control Statements in PythonPriyankaC44
This document discusses looping statements and control statements in Python. It explains while loops, for loops, and the use of break, continue, else and pass statements. Some key points:
- While loops repeatedly execute statements as long as a condition is true. For loops iterate over a sequence.
- Break and continue statements can alter loop flow - break exits the entire loop, continue skips to the next iteration.
- The else block in loops runs when the condition becomes false (while) or the sequence is complete (for).
- Pass is a null operation used when syntax requires a statement but no operation is needed.
Several examples of loops and control statements are provided to demonstrate their usage.
Youtube Link: https://youtu.be/woVJ4N5nl_s
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka PPT on 'Python Basics' will help you understand what exactly makes Python special and covers all the basics of Python programming along with examples.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This lecture covers data structures and iteration. It discusses arrays as ordered collections of values that allow items to be accessed by index. Python offers two array-like data structures: lists, which are mutable, and tuples, which are immutable. Loops allow code to repeatedly execute and come in two main types - while loops, which repeat while a condition is true, and for loops. Break and continue statements can be used in loops to exit or skip iterations under certain conditions.
This document discusses control flow, functions, and recursion in Python. It begins by defining boolean expressions and explaining different types of operators like arithmetic, relational, logical, and assignment operators. It then covers conditional execution using if, else, and elif statements. Loops like while and for are explained along with break, continue, and pass statements. Functions are described as being able to return values. Finally, recursion is defined as a function calling itself, either directly or indirectly.
This document provides an overview of topics covered on Day 1 of a Python training, including strings, control flow, and data structures. Strings topics include methods, formatting, and Unicode. Control flow covers conditions, loops (for and while), and range. Data structures discussed are tuples, lists, dictionaries, and sorting. The document concludes with an overview of topics for the next session, including functions, object-oriented programming, and Python packaging.
Python Programming - III. Controlling the FlowRanel Padon
This document discusses controlling program flow in Python programming. It covers sequence, selection, and repetition control structures including if/else statements, while loops, for loops, and nested control structures. Examples of pseudocode and Python code are provided to illustrate different control structures. The document also discusses logical operators, augmented assignment operators, and practice exercises for readers to test their understanding of controlling program flow.
This Programming Language Python Tutorial is very well suited for beginners and also for experienced programmers. This specially designed free Python tutorial will help you learn Python programming most efficiently, with all topics from basics to advanced (like Web-scraping, Django, Learning, etc.) with examples.
What is Python?
Python is a high-level, general-purpose, and very popular programming language. Python programming language (latest Python 3) is being used in web development, and Machine Learning applications, along with all cutting-edge technology in Software Industry. Python language is being used by almost all tech-giant companies like – Google, Amazon, Facebook, Instagram, Dropbox, Uber… etc.
Writing your first Python Program to Learn PythonSetting up Python
Download and Install Python 3 Latest Version
How to set up Command Prompt for Python in Windows10
Setup Python VS Code or PyCharm
Creating Python Virtual Environment in Windows and Linux
Note: Python 3.13 is the latest version of Python, but Python 3.12 is the latest stable version.
Now let us deep dive into the basics and components to learn Python Programming:
Getting Started with Python Programming
Welcome to the Python tutorial section! Here, we’ll cover the essential elements you need to kickstart your journey in Python programming. From syntax and keywords to comments, variables, and indentation, we’ll explore the foundational concepts that underpin Python development.
Learn Python Basics
Syntax
Keywords in Python
Comments in Python
Learn Python Variables
Learn Python Data Types
Indentation and why is it important in Python
Learn Python Input/Output
In this segment, we delve into the fundamental aspects of handling input and output operations in Python, crucial for interacting with users and processing data effectively. From mastering the versatile print() function to exploring advanced formatting techniques and efficient methods for receiving user input, this section equips you with the necessary skills to harness Python’s power in handling data streams seamlessly.
Python print() function
The document discusses various operators and control flow statements in Python. It covers arithmetic, comparison, logical, assignment and membership operators. It also covers if-else conditional statements, while and for loops, and break, continue and pass statements used with loops. The key points are:
- Python supports operators like +, -, *, / etc. for arithmetic and ==, !=, >, < etc. for comparison.
- Control flow statements include if-else for conditional execution, while and for loops for repetition, and break/continue to control loop flow.
- The while loop repeats as long as the condition is true. for loops iterate over sequences like lists, tuples using a loop variable.
This document provides a summary of Python programming concepts including conditionals, iteration, functions, strings and lists. It covers topics such as if/else statements, for/while loops, functions with parameters and return values. String methods and slicing are explained. Lists are discussed as arrays in Python. Example programs for square root, GCD, exponentiation and searching arrays are provided to illustrate the concepts.
The document discusses Python operators and control structures. It covers various types of operators in Python like arithmetic, comparison, assignment, logical, bitwise, and membership operators. It provides examples of each operator type. The document also discusses conditional statements like if, elif, else and conditional expressions. It explains while and for loops in Python along with loop control statements like break, continue, and pass. The last section gives some examples of using operators and control structures in Python programs.
Programming Fundamentals Lecture 3 covered data structures and iteration. Data structures allow storing multiple pieces of data in an organized way. Arrays are ordered collections of values that can be accessed by index. Python offers lists and tuples, where lists are mutable and tuples are immutable. Loops called iteration allow repeatedly running a block of code. While loops repeat while a condition is true. Break and continue can be used in loops to exit early or skip iterations conditionally.
The document provides an introduction and comparison of Python and C programming languages. Some key points:
- Python is an interpreted language while C needs compilation. Python makes program development faster.
- Variables, input/output, arrays, control structures like if/else, for loops work differently in Python compared to C.
- Python uses lists instead of arrays. Lists are mutable and support slicing.
- Strings are treated as character lists in Python.
- Functions are defined using def keyword in Python.
- The document also introduces sequences (strings, tuples, lists), dictionaries, and sets in Python - their usage and operations.
Good morning Salma Hayek you have to do is your purpose of the best time to plant grass seed in the morning Salma Hayek you have to do is your purpose of the best time to plant grass seed in the morning Salma Hayek you have to do is your purpose of the best time to plant grass seed in the morning Salma Hayek you want me potter to plant in spring I will be there in the morning Salma Hayek you have a nice weekend with someone legally allowed in spring a contract for misunderstanding and tomorrow I hope it was about the best msg you want me potter you want me potter you want to do is your purpose of the best time to plant grass seed in the morning Salma Hayek you have to do it up but what do you think about the pros of the morning Salma good mornings are you doing well and tomorrow I hope it goes well and I hope you to do it goes well and tomorrow I have to be there at both locations in spring a nice day service and I hope it goes away soon as I can you have to be to get a I hope it goes away soon I hope it goes away soon I hope it goes away soon as I can you have to be to work at a time I can do is
hi my self jyoti . i have made ppt for students,they can easily learn python from this ppt. students also subscribw my youtube channel for computer related courses i.e jdcomputerdesignclasses where i have made lots of video on office ,python, scratch, html so you can learn from there. All types python content clear in this presentation.
This document provides an overview of key concepts for data science in Python, including popular Python packages like NumPy and Pandas. It introduces Python basics like data types, operators, and functions. It then covers NumPy topics such as arrays, slicing, splitting and reshaping arrays. It discusses Pandas Series and DataFrame data structures. Finally, it covers operations on missing data and combining datasets using merge and join functions.
This document provides an outline and overview of a presentation on learning Python for beginners. The presentation covers what Python is, why it is useful, how to install it and common editors used. It then discusses Python variables, data types, operators, strings, lists, tuples, dictionaries, conditional statements, looping statements and real-world applications. Examples are provided throughout to demonstrate key Python concepts and how to implement various features like functions, methods and control flow. The goal is to give attendees an introduction to the Python language syntax and capabilities.
The document provides an overview of the Python programming language. It discusses what Python is, its history and origins, why it is popular, common applications, and who uses it. It then covers running Python, variables, data types, input/output functions, conditional and looping statements. Specific Python concepts explained in more detail include variables, common data types (numeric, string, list, tuple, dictionary, Boolean), functions for lists and tuples, and if/else and for/while loop statements. The document is intended as an introductory guide to Python.
Rose Cultivation Practices by Kushal Lamichhane.pdfkushallamichhame
This includes the overall cultivation practices of Rose prepared by:
Kushal Lamichhane (AKL)
Instructor
Shree Gandhi Adarsha Secondary School
Kageshowri Manohara-09, Kathmandu, Nepal
Unit- 4 Biostatistics & Research Methodology.pdfKRUTIKA CHANNE
Blocking and confounding (when a third variable, or confounder, influences both the exposure and the outcome) system for Two-level factorials (a type of experimental design where each factor (independent variable) is investigated at only two levels, typically denoted as "high" and "low" or "+1" and "-1")
Regression modeling (statistical model that estimates the relationship between one dependent variable and one or more independent variables using a line): Hypothesis testing in Simple and Multiple regression models
Introduction to Practical components of Industrial and Clinical Trials Problems: Statistical Analysis Using Excel, SPSS, MINITAB®️, DESIGN OF EXPERIMENTS, R - Online Statistical Software to Industrial and Clinical trial approach
Ray Dalio How Countries go Broke the Big CycleDadang Solihin
A complete and practical understanding of the Big Debt Cycle. A much more practical understanding of how supply and demand really work compared to the conventional economic thinking. A complete and practical understanding of the Overall Big Cycle, which is driven by the Big Debt Cycle and the other major cycles, including the big political cycle within countries that changes political orders and the big geopolitical cycle that changes world orders.
How to Create Quotation Templates Sequence in Odoo 18 SalesCeline George
In this slide, we’ll discuss on how to create quotation templates sequence in Odoo 18 Sales. Odoo 18 Sales offers a variety of quotation templates that can be used to create different types of sales documents.
HOW YOU DOIN'?
Cool, cool, cool...
Because that's what she said after THE QUIZ CLUB OF PSGCAS' TV SHOW quiz.
Grab your popcorn and be seated.
QM: THARUN S A
BCom Accounting and Finance (2023-26)
THE QUIZ CLUB OF PSGCAS.
How to Create a Rainbow Man Effect in Odoo 18Celine George
In Odoo 18, the Rainbow Man animation adds a playful and motivating touch to task completion. This cheerful effect appears after specific user actions, like marking a CRM opportunity as won. It’s designed to enhance user experience by making routine tasks more engaging.
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.
How to Manage Upselling of Subscriptions in Odoo 18Celine George
Subscriptions in Odoo 18 are designed to auto-renew indefinitely, ensuring continuous service for customers. However, businesses often need flexibility to adjust pricing or quantities based on evolving customer needs.
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
Exploring Ocean Floor Features for Middle SchoolMarie
This 16 slide science reader is all about ocean floor features. It was made to use with middle school students.
You can download the PDF at thehomeschooldaily.com
Thanks! Marie
This presentation has been made keeping in mind the students of undergraduate and postgraduate level. To keep the facts in a natural form and to display the material in more detail, the help of various books, websites and online medium has been taken. Whatever medium the material or facts have been taken from, an attempt has been made by the presenter to give their reference at the end.
In the seventh century, the rule of Sindh state was in the hands of Rai dynasty. We know the names of five kings of this dynasty- Rai Divji, Rai Singhras, Rai Sahasi, Rai Sihras II and Rai Sahasi II. During the time of Rai Sihras II, Nimruz of Persia attacked Sindh and killed him. After the return of the Persians, Rai Sahasi II became the king. After killing him, one of his Brahmin ministers named Chach took over the throne. He married the widow of Rai Sahasi and became the ruler of entire Sindh by suppressing the rebellions of the governors.
THE QUIZ CLUB OF PSGCAS BRINGS T0 YOU A FUN-FILLED, SEAT EDGE BUSINESS QUIZ
DIVE INTO THE PRELIMS OF BIZCOM 2024
QM: GOWTHAM S
BCom (2022-25)
THE QUIZ CLUB OF PSGCAS
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.
Completed Sunday 6/8. For Weekend 6/14 & 15th. (Fathers Day Weekend US.) These workshops are also timeless for future students TY. No admissions needed.
A 9th FREE WORKSHOP
Reiki - Yoga
“Intuition-II, The Chakras”
Your Attendance is valued.
We hit over 5k views for Spring Workshops and Updates-TY.
Thank you for attending our workshops.
If you are new, do welcome.
Grad Students: I am planning a Reiki-Yoga Master Course (As a package). I’m Fusing both together.
This will include the foundation of each practice. Our Free Workshops can be used with any Reiki Yoga training package. Traditional Reiki does host rules and ethics. Its silent and within the JP Culture/Area/Training/Word of Mouth. It allows remote healing but there’s limits As practitioners and masters, we are not allowed to share certain secrets/tools. Some content is designed only for “Masters”. Some yoga are similar like the Kriya Yoga-Church (Vowed Lessons). We will review both Reiki and Yoga (Master tools) in the Course upcoming.
S9/This Week’s Focus:
* A continuation of Intuition-2 Development. We will review the Chakra System - Our temple. A misguided, misused situation lol. This will also serve Attunement later.
Thx for tuning in. Your time investment is valued. I do select topics related to our timeline and community. For those seeking upgrades or Reiki Levels. Stay tuned for our June packages. It’s for self employed/Practitioners/Coaches…
Review & Topics:
* Reiki Is Japanese Energy Healing used Globally.
* Yoga is over 5k years old from India. It hosts many styles, teacher versions, and it’s Mainstream now vs decades ago.
* Anything of the Holistic, Wellness Department can be fused together. My origins are Alternative, Complementary Medicine. In short, I call this ND. I am also a metaphysician. I learnt during the 90s New Age Era. I forget we just hit another wavy. It’s GenZ word of Mouth, their New Age Era. WHOA, History Repeats lol. We are fusing together.
* So, most of you have experienced your Spiritual Awakening. However; The journey wont be perfect. There will be some roller coaster events. The perks are: We are in a faster Spiritual Zone than the 90s. There’s more support and information available.
(See Presentation for all sections, THX AGAIN.)
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
*Order Hemiptera:*
Hemiptera, commonly known as true bugs, is a large and diverse order of insects that includes cicadas, aphids, leafhoppers, and shield bugs. Characterized by their piercing-sucking mouthparts, Hemiptera feed on plant sap, other insects, or small animals. Many species are significant pests, while others are beneficial predators.
*Order Neuroptera:*
Neuroptera, also known as net-winged insects, is an order of insects that includes lacewings, antlions, and owlflies. Characterized by their delicate, net-like wing venation and large, often prominent eyes, Neuroptera are predators that feed on other insects, playing an important role in biological control. Many species have aquatic larvae, adding to their ecological diversity.
2. 2
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Booleans & Comparisons
In Python, there are two Boolean values: True and False. They can be created
by comparing values, for instances by using the equal operator ==.
Another comparison operator, the not equal operator (!=), evaluates to True if
the items being compares aren’t equal, and False if they are.
Compares both Numbers as well as Strings.
Python also has operators that determine whether the given number (integer
or float) is greater than or smaller than another. These are < and >
respectively.
Also we have, >= Greater than or Equal & <= Smaller than or Equal. Except
they return True when comparing equal numbers.
>>> value = True
>>> value
True
>>> 5 == 15
False
>>> "Hello" == "Hello"
True
>>> "Hi" == "hi"
False
>>> 1 != 1
False
>>> "cat" != "mat"
True
3. 3
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Greater than and smaller than operators are also used to compare Strings
lexicographically.
>>> 9 > 4
True
>>> 8 < 8
False
>>> 4 <= 7
True
>>> 8 >= 8.0
True
4. 4
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
if Statements
You can use if statements to run code if a certain condition holds.
If an expression evaluates to True, some statements are carried out.
Otherwise, they aren’t carried out.
Python uses indentation (white space at the beginning of a line) to delimit
blocks of code. Other languages, such as C, use curly braces to accomplish this,
but in Python indentation is mandatory; programs won’t work without it.
Notice the colon at the end of the expression in the if statement.
As the program contains multiple lines of code, you should create it as a
separate file and run it.
To perform more complex checks, if statements can be nested, one inside the
other.
Where inner if statement will be a part of outer if statement. This is used to
see whether multiple conditions are satisfied.
Output:
if expression:
statements
no = 24
if no > 18:
print("Greater than 18")
if no <= 50:
print("Between 18 & 50")
Greater than 18
Between 18 & 50
5. 5
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
else Statements
An else statement follows an if statement & contains code that is called when
the if statement evaluates to False.
Output:
You can chain if and else statements to determine which option in a series of
possibilities is true.
X = 4
if x == 8:
print(“Yes”)
else:
print(“No”)
>>>
No
>>>
6. 6
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
elif Statements
The elif (short of else if) statement is a shortcut to use when chaining if and
else statements. A series of if elif statements can have a final else block, which
is called if none of the if or elif expression is True.
Output:
num = 24
if num == 5:
print("Number is 5")
elif num == 11:
print("Number is 11")
elif num == 24:
print("Number is 24")
else:
print("Number isn't 5,11 or 24")
>>>
Number is 24
>>>
7. 7
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Boolean Logic
Python’s Boolean operators are and, or and not.
The and operator takes two arguments, and evaluates as True if, and only if,
both of its arguments are True. Otherwise, it evaluates to False.
Python uses words for its Boolean operators, whereas most other languages
use symbols such as &&, || an !.
Similarly, Boolean or operator takes two arguments. It evaluates to True if
either (or both) of its arguments are True, and False if both arguments are
False.
The result of not True is False, and not False goes to True.
>>> 1 == 1 and 2 == 2
True
>>> 1 == 1 and 2 == 3
False
>>> 1 != 1 and 2 == 2
False
>>> 4 < 2 and 2 > 6
False
>>> not 1 == 1
False
>>> not 7 > 9
True
8. 8
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Operator Precedence
Operator Precedence is a very important concept in programming. It is an
extension of the mathematical idea of order of operation.
(multiplication being performed before addition etc.) to include other
operators, such as those in Boolean logic.
The below code shows that == has a higher precedence than or.
>>> False == False or True
True
>>> False == (False or True)
False
>>> (False == False) or True
True
9. 9
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
List of Python’s operators, from highest precedence to lowest.
** Exponentiation (raise to the power)
~ + - Complement, unary plus and minus
(method names for the last two are +@ and -@)
* / % // Multiply, divide, modulo and floor division
+ - Addition and Subtraction
>> << Right and Left bitwise shift
& Bitwise ‘AND’
^ | Bitwise exclusive ‘OR’ and regular ‘OR’
<= == => Comparison operators
< > == != Equality Operators
= %= /= //= -= += *= **= Assignment Operators
is is not Identity operators
in not in Membership Operators
not or and Logical operators
Operator | Description
10. 10
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
while Loop
An if statement is run once if its condition evaluates to True, and never if it
evaluates to False.
A while statement is similar, except that it can be run more than once. The
statements inside it are repeatedly executed, as long as the condition holds.
Once it evaluates to False, the next section of code is executed.
Program:
Output:
The infinite loop is a special kind of while loop, it never stops running. Its
condition always remains True.
This program would indefinitely print “In the loop”.
i = 1
while i <= 5:
print(i)
i+=1
print("Finished !")
1
2
3
4
5
Finished !
while 1 == 1:
print(“In the loop”)
11. 11
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
You can stop the program’s execution by using the Ctrl-C shortcut or by closing
the program.
break
To end a while loop prematurely, the break statement can be used.
When encountered inside a loop, the break statement causes the loop to finish
immediately.
Program:
Output:
i = 0
while 1 == 1:
print(i)
i+=1
if i >= 5:
print("Breaking")
break
print("Finished")
0
1
2
3
4
Breaking
Finished
12. 12
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Continue
Another statement that can be used within loops is continue.
Unlike break, continue jumps back to the top of the loop, rather than stopping
it.
Program:
Output:
i=0
while True:
i+=1
if i == 2:
print("Skipping 2")
continue
if i == 5:
print("Breaking")
break
print(i)
print("Finished")
1
Skipping 2
3
4
Breaking
Finished
13. 13
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Lists:
Lists are another type of object in Python. They are used to store an indexed
list of items.
A list is created using square brackets with commas separating items.
The certain item in the list can be accessed by using its index in square
brackets.
Program:
Output:
The first list item’s index is 0, rather than 1, as might be expected.
An empty list can be created with an empty pair of square brackets.
It is perfectly valid to write comma after last item of the list, and it is
encouraged in some cases.
words = ["I","Love","Python"]
print(words[0])
print(words[1])
print(words[2])
I
Love
Python
empty_list = []
14. 14
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Typically, a list will contain items of a single item type, but it is also possible to
include several different types.
Lists can also be nested within other lists.
Program:
Output:
Lists of lists are often used to represent 2D grids, as Python lacks the
multidimensional arrays that would be used for this in other languages.
number = 33
things = ["String",0,[11,22,number],3.14]
print(things[0])
print(things[1])
print(things[2])
print(things[2][2])
String
0
[11, 22, 33]
33
15. 15
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Indexing out of the bounds of possible list values causes an IndexError.
Some types, such as strings, can be indexed like lists. Indexing strings behaves
as though you are indexing a list containing each character in the string.
For other types, such as integers, indexing them isn’t possible, and it causes a
TypeError.
Program:
Output:
Output:
str = “Hello World!”
print(str[6])
>>>
W
>>>
16. 16
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
List Operations
The items at a certain index in a list can be reassigned.
Example:
Output:
Lists can be added and multiplied in the same way as strings.
Program:
Output:
Lists and strings are similar in many ways – strings can be thought of as lists of
characters that can’t be changed.
>>>
[24,24,55,24,24]
>>>
nums = [24,24,24,24,24]
nums[2] = 55
print(nums)
nums = [1,2,3]
print(nums + [4,5,6])
print(nums *3)
[1, 2, 3, 4, 5, 6]
[1, 2, 3, 1, 2, 3, 1, 2, 3]
17. 17
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
To check if an item is in a list, the in operator can be used. It returns True if the
item occurs one or more times in the list, and False if it doesn’t.
Program:
Output:
The in operator is also used to determine whether or not a string is a
substring of another string.
words = ["Donut","Eclair","Froyo","Gingerbread"]
print("Donut" in words)
print("Froyo" in words)
print("Lolipop" in words)
>>>
True
True
False
>>>
18. 18
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
To check if an item is not in a list, you can use the not operator in one of the
following ways:
Program:
Output:
>>>
True
True
False
False
>>>
nums = [11,22,33]
print(not 44 in nums)
print(44 not in nums)
print(not 22 in nums)
print(22 not in nums)
19. 19
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
List Functions
Another way of altering lists is using the append method. This adds an item to
the end of an existing list.
Program:
Output:
The dot before append is there because it is a method of the list class.
To get the number of items in a list, you can use the len function.
Program:
Output:
Unlike append, len is a normal function, rather than a method. This means it
is written before the list it is being called on, without a dot.
nums = [1,2,3]
nums.append(4)
print(nums)
>>>
[1, 2, 3, 4]
>>>
nums=[1,2,3,4,5]
print(len(nums))
>>>
5
>>>
20. 20
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
The insert method is similar to append, except that it allows you to insert a
new item at any position in the list, as opposed to just at the end.
Program:
Output:
The index method finds the first occurrence of a list item and returns its index.
If the item isn’t in the list, it raises a ValueError.
Program:
Output:
words = ["Python","Fun"]
index = 1
words.insert(index,"is")
print(words)
2
0
ValueError: 'z' is not in list
>>>
>>>
['Python', 'is', 'Fun']
>>>
letters = ['a','e','i','o','u']
print(letters.index('i'))
print(letters.index('a'))
print(letters.index('z'))
21. 21
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
There are a few more useful functions and methods for lists.
max(list): Returns the list item with the maximum value.
min(list): Returns the list item with the minimum value.
list.count(obj): Returns a count of how many times an item occurs in a list.
list.remove(obj): Removes an object from a list.
List.reverse(): Reverse objects in a list.
22. 22
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Range
The range function creates a sequential list of numbers.
The code below generates a list containing all of the integers, up to 10.
Example:
Output:
The call to list is necessary because range by itself creates a range object, and
this must be converted to a list if you want to use it as one.
If range is called with one argument, it produces an object with values from 0
to that argument. If it is called with two arguments, it produces values from
the first to the second.
Program:
Output:
>>> numbers = list(range(10))
>>> print(numbers)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>
[3, 4, 5, 6, 7]
True
>>>
numbers = list(range(3,8))
print(numbers)
print(range(20) == range(0,20))
23. 23
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
range can have a third argument, which determines the interval of the
sequence produced. This third argument must be an integer.
Example:
Output:
[5, 7, 9, 11, 13, 15, 17, 19]
>>> numbers = list(range(5,20,2))
>>> print(numbers)
24. 24
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Loops
Sometimes, you need to perform code on each item in a list. This is called
iteration, and it can be accomplished with a while loop and a counter variable.
Program:
Output:
The example above iterates through all items in the list, accesses them using
their indices, and prints them with exclamation marks.
words = ["Python","Programming","Is","Fun"]
counter = 0
max_index = len(words) - 1
while counter <= max_index:
word = words[counter]
print(word + "!")
counter = counter + 1
>>>
Python!
Programming!
Is!
Fun!
>>>
25. 25
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
Iterating through a list using a while loop requires quite a lot of code, so
Python provides the for loop as a shortcut that accomplishes the same thing.
The same code from the previous example can be written with a for loop, as
follows:
Program:
Output:
The for loop in Python is like the foreach loop in other languages.
words = ["Python","Programming","Is","Fun"]
for word in words:
print(word + "!")
>>>
Python!
Programming!
Is!
Fun!
>>>
26. 26
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
The for loop is commonly used to repeat some code a certain number of times.
This is done by combining for loops with range objects.
Program:
Output:
You don’t need to call list on the range object when it is used in a for loop,
because it isn’t being indexed, so a list isn’t required.
for i in range(5):
print("Python!")
>>>
Python!
Python!
Python!
Python!
Python!
>>>
27. 27
CONTROL STRUCTURES IN PYTHON SUMIT S. SATAM
You were reading:
1. Basic Concepts In Python
2.Control Structures In Python
Booleans & Comparisons
if Statements
else Statements
elif Statements
Boolean Logic
Operator Precedence
while Loop
Lists
List Operations
List Functions
Range
Loops
3.Functions & Modules In Python
4.Exceptions & Files In Python
5.More Types In Python
6.Functional Programming with Python
7.Object-Oriented Programming with Python
8.Regular Expressions In Python
9.Pythonicness & Packaging