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.
The document provides information about the Python programming language. It discusses that Python is an interpreted, interactive, and object-oriented language well-suited for beginners. It provides details on Python's history and development as well as an overview of its core features like a broad standard library, portability, extensibility, support for databases, and an interactive mode. The document also describes how to get Python, run Python code through an interactive interpreter or script, and use integrated development environments. It covers basic programming concepts in Python like arithmetic, decision making with if/else statements, loops, lists, and functions.
This document provides a cheat sheet for Python basics. It begins with an introduction to Python and its advantages. It then covers key Python data types like strings, integers, floats, lists, tuples, and dictionaries. It explains how to define variables, functions, conditional statements, and loops. The document also demonstrates built-in functions, methods for manipulating common data structures, and other Python programming concepts in a concise and easy to understand manner.
The document provides an overview of the Python programming language. It discusses Python's history and versions, development environments, frameworks, uses, and basic features. The summary covers:
Python is an interpreted, object-oriented programming language created in 1989. It has undergone several major versions and is widely used for web development, science, and more. Python code can be written and run in various integrated development environments. It supports objects, modules, exceptions, and other features for structured programming.
The document provides an introduction to Python programming. It discusses installing and running Python, basic Python syntax like variables, data types, conditionals, and functions. It emphasizes that Python uses references rather than copying values, so assigning one variable to another causes both to refer to the same object.
After the end of lesson you will be able to learn Python basics-What Python is? Its releases. Where we can use Python? Python Features. Tokens, comments variables etc... In out next PPT you will learn how to input and get output in Python
This document provides an overview of the Python programming language. It covers Python basics like syntax, datatypes, modules, and control structures. It also discusses topics like functions, classes, files, and popular Python modules. The document contains an agenda that outlines these topics and provides code samples to illustrate Python concepts hands-on. It aims to equip readers with foundational Python programming knowledge.
This document provides an introduction and overview of the Python programming language. It covers Python's history and key features such as being object-oriented, dynamically typed, batteries included, and focusing on readability. It also discusses Python's syntax, types, operators, control flow, functions, classes, imports, error handling, documentation tools, and popular frameworks/IDEs. The document is intended to give readers a high-level understanding of Python.
The document provides information about the Python programming language. It discusses that Python is an interpreted, interactive, and object-oriented language well-suited for beginners. It provides details on Python's history and development as well as an overview of its core features like a broad standard library, portability, extensibility, support for databases, and an interactive mode. The document also describes how to get Python, run Python code through an interactive interpreter or script, and use integrated development environments. It covers basic programming concepts in Python like arithmetic, decision making with if/else statements, loops, lists, and functions.
This document provides a cheat sheet for Python basics. It begins with an introduction to Python and its advantages. It then covers key Python data types like strings, integers, floats, lists, tuples, and dictionaries. It explains how to define variables, functions, conditional statements, and loops. The document also demonstrates built-in functions, methods for manipulating common data structures, and other Python programming concepts in a concise and easy to understand manner.
The document provides an overview of the Python programming language. It discusses Python's history and versions, development environments, frameworks, uses, and basic features. The summary covers:
Python is an interpreted, object-oriented programming language created in 1989. It has undergone several major versions and is widely used for web development, science, and more. Python code can be written and run in various integrated development environments. It supports objects, modules, exceptions, and other features for structured programming.
The document provides an introduction to Python programming. It discusses installing and running Python, basic Python syntax like variables, data types, conditionals, and functions. It emphasizes that Python uses references rather than copying values, so assigning one variable to another causes both to refer to the same object.
After the end of lesson you will be able to learn Python basics-What Python is? Its releases. Where we can use Python? Python Features. Tokens, comments variables etc... In out next PPT you will learn how to input and get output in Python
This document provides an overview of the Python programming language. It covers Python basics like syntax, datatypes, modules, and control structures. It also discusses topics like functions, classes, files, and popular Python modules. The document contains an agenda that outlines these topics and provides code samples to illustrate Python concepts hands-on. It aims to equip readers with foundational Python programming knowledge.
This document provides an introduction and overview of the Python programming language. It covers Python's history and key features such as being object-oriented, dynamically typed, batteries included, and focusing on readability. It also discusses Python's syntax, types, operators, control flow, functions, classes, imports, error handling, documentation tools, and popular frameworks/IDEs. The document is intended to give readers a high-level understanding of Python.
The document discusses Python programming language. Some key points:
- Python was invented by Guido Van Rossum and is a combination of various programming languages.
- It is a general purpose, high-level programming language that is interpreted, interactive, object-oriented and extensible.
- Python can be used for web applications, desktop applications, data analysis, artificial intelligence, and more. Popular companies that use Python include Google, YouTube, and NASA.
- Python code is portable and can run on various platforms. It has a simple syntax and is easy to learn.
Python An Introduction, A presentation Developed by Swarit Wadhe. This Slide Will Give you basic information about python (Origin, Codes and difference from other languages).
I hope you'll find this helpfull and if you do please share it with your fellows.
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
If you're absolutely new to Python, and to programming in general, this is the place to start!
Here's the breakdown: by the end of this workshop, you'll have Python downloaded onto your personal machine; have a general idea of what Python can help you do; be pointed in the direction of some excellent practice materials; and have a basic understanding of the syntax of the language.
Please don't forget to bring your laptop!
Audience: "Python 101" is geared toward individuals who are new to programming. If you've had some programming experience (shell scripting, MATLAB, Ruby, etc.), then you'll probably want to check out the more intermediate workshop, "Python 101++".
The Agenda for the Webinar:
1. Introduction to Python.
2. Python and Big Data.
3. Python and Data Science.
4. Key features of Python and their usage in Business Analytics.
5. Business Analytics with Python – Real world Use Cases.
Introduction to control structure in C Programming Language include decision making (if statement, if..else statement, if...else if...else statement, nested if...else statement, switch...case statement), Loop(for loop, while loop, do while loop, nested loop) and using keyword(break, continue and goto)
Python is a versatile, object-oriented programming language that can be used for web development, data analysis, and more. It has a simple syntax and is easy to read and learn. Key features include being interpreted, dynamically typed, supporting functional and object-oriented programming. Common data types include numbers, strings, lists, dictionaries, tuples, and files. Functions and classes can be defined to organize and reuse code. Regular expressions provide powerful string manipulation. Python has a large standard library and is used widely in areas like GUIs, web scripting, AI, and scientific computing.
The document discusses various string manipulation techniques in Python such as getting the length of a string, traversing strings using loops, slicing strings, immutable nature of strings, using the 'in' operator to check for substrings, and comparing strings. Key string manipulation techniques covered include getting the length of a string using len(), extracting characters using indexes and slices, traversing strings with for and while loops, checking for substrings with the 'in' operator, and comparing strings.
The document provides an introduction and overview of the Python programming language. It discusses that Python is an interpreted, object-oriented, high-level programming language that is easy to learn and read. It also covers Python features such as portability, extensive standard libraries, and support for functional, structured, and object-oriented programming. The document then discusses Python data types including numbers, strings, and various Python syntax elements before concluding with the history and evolution of the Python language through various versions.
The document discusses symbol tables, which are data structures used by compilers to track semantic information about identifiers, variables, functions, classes, etc. It provides details on:
- How various compiler phases like lexical analysis, syntax analysis, semantic analysis, code generation utilize and update the symbol table.
- Common data structures used to implement symbol tables like linear lists, hash tables and how they work.
- The information typically stored for different symbols like name, type, scope, memory location etc.
- Organization of symbol tables for block-structured vs non-block structured languages, including using multiple nested tables vs a single global table.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Introduction To Python' will help you establish a strong hold on all the fundamentals in the Python programming language. Below are the topics covered in this PPT:
Introduction To Python
Keywords And Identifiers
Variables And Data Types
Operators
Loops In Python
Functions
Classes And Objects
OOPS Concepts
File Handling
YouTube Video: https://youtu.be/uYjRzbP5aZs
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
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
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.
These are the slides I was using when delivering the Python Crash Course (https://www.meetup.com/life-michael/events/247984087/). The crash course was delivered in Hebrew. More info about the Python Programming course I deliver can be found at python.course.lifemichael.com.
This document provides an introduction and overview of the Python programming language. It discusses what Python is, its features, applications, and how to install Python on Windows and Linux systems. It also covers Python basics like variables, data types, operators, comments, conditional statements like if/else, and loops like for, while, and nested loops. Examples are provided for key concepts. The document is intended as a beginner tutorial for learning Python.
The document provides an introduction to Python programming including its features, uses, history, and installation process. Some key points covered include:
- Python is an interpreted, object-oriented programming language that is used for web development, scientific computing, and desktop applications.
- It was created by Guido van Rossum in 1991 and named after the Monty Python comedy group.
- To install Python on Windows, users download the latest version from python.org and run the installer, which also installs the IDLE development environment.
- The document then covers basic Python concepts like variables, data types, operators, and input/output functions.
This document provides an introduction to the Python programming language over 30 minutes. It covers basic Python concepts like variables, data types, conditionals, loops, functions, imports, strings, lists, tuples, sets, dictionaries, and classes. Code examples are provided to demonstrate how to use these features. The document encourages learners to continue learning Python through online documentation and resources.
The document provides an introduction to Python programming by discussing statements and syntax. It covers assignment statements, expression statements, print operations, conditional statements like if/else, and loop statements like while and for. It explains how Python programs are composed of modules containing statements with expressions. Truth tests for conditionals and built-in functions like range, zip that can be used in loops are also overviewed.
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.
This document provides an agenda and overview for a Python tutorial presented over multiple sessions. The first session introduces Python and demonstrates how to use the Python interpreter. The second session covers basic Python data structures like lists, modules, input/output, and exceptions. An optional third session discusses unit testing. The document explains that Python is an easy to learn yet powerful programming language that supports object-oriented programming and high-level data structures in an interpreted, dynamic environment.
In Python, data types define the type of data that can be stored and manipulated in variables. Python is a dynamically typed language, meaning you don't need to explicitly declare the data type of a variable; Python infers it based on the value assigned to the variable.
This document outlines the objectives and content of the course GE3151 Problem Solving and Python Programming. The course is intended to teach students the basics of algorithmic problem solving using Python. It covers topics like computational thinking, Python data types, control flow, functions, strings, lists, tuples, dictionaries, files and modules. The course contains 5 units that will teach students how to define problems, develop algorithms, implement solutions in Python using conditionals, loops, functions and data structures, perform input/output with files and use modules and packages.
The document discusses Python programming language. Some key points:
- Python was invented by Guido Van Rossum and is a combination of various programming languages.
- It is a general purpose, high-level programming language that is interpreted, interactive, object-oriented and extensible.
- Python can be used for web applications, desktop applications, data analysis, artificial intelligence, and more. Popular companies that use Python include Google, YouTube, and NASA.
- Python code is portable and can run on various platforms. It has a simple syntax and is easy to learn.
Python An Introduction, A presentation Developed by Swarit Wadhe. This Slide Will Give you basic information about python (Origin, Codes and difference from other languages).
I hope you'll find this helpfull and if you do please share it with your fellows.
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
If you're absolutely new to Python, and to programming in general, this is the place to start!
Here's the breakdown: by the end of this workshop, you'll have Python downloaded onto your personal machine; have a general idea of what Python can help you do; be pointed in the direction of some excellent practice materials; and have a basic understanding of the syntax of the language.
Please don't forget to bring your laptop!
Audience: "Python 101" is geared toward individuals who are new to programming. If you've had some programming experience (shell scripting, MATLAB, Ruby, etc.), then you'll probably want to check out the more intermediate workshop, "Python 101++".
The Agenda for the Webinar:
1. Introduction to Python.
2. Python and Big Data.
3. Python and Data Science.
4. Key features of Python and their usage in Business Analytics.
5. Business Analytics with Python – Real world Use Cases.
Introduction to control structure in C Programming Language include decision making (if statement, if..else statement, if...else if...else statement, nested if...else statement, switch...case statement), Loop(for loop, while loop, do while loop, nested loop) and using keyword(break, continue and goto)
Python is a versatile, object-oriented programming language that can be used for web development, data analysis, and more. It has a simple syntax and is easy to read and learn. Key features include being interpreted, dynamically typed, supporting functional and object-oriented programming. Common data types include numbers, strings, lists, dictionaries, tuples, and files. Functions and classes can be defined to organize and reuse code. Regular expressions provide powerful string manipulation. Python has a large standard library and is used widely in areas like GUIs, web scripting, AI, and scientific computing.
The document discusses various string manipulation techniques in Python such as getting the length of a string, traversing strings using loops, slicing strings, immutable nature of strings, using the 'in' operator to check for substrings, and comparing strings. Key string manipulation techniques covered include getting the length of a string using len(), extracting characters using indexes and slices, traversing strings with for and while loops, checking for substrings with the 'in' operator, and comparing strings.
The document provides an introduction and overview of the Python programming language. It discusses that Python is an interpreted, object-oriented, high-level programming language that is easy to learn and read. It also covers Python features such as portability, extensive standard libraries, and support for functional, structured, and object-oriented programming. The document then discusses Python data types including numbers, strings, and various Python syntax elements before concluding with the history and evolution of the Python language through various versions.
The document discusses symbol tables, which are data structures used by compilers to track semantic information about identifiers, variables, functions, classes, etc. It provides details on:
- How various compiler phases like lexical analysis, syntax analysis, semantic analysis, code generation utilize and update the symbol table.
- Common data structures used to implement symbol tables like linear lists, hash tables and how they work.
- The information typically stored for different symbols like name, type, scope, memory location etc.
- Organization of symbol tables for block-structured vs non-block structured languages, including using multiple nested tables vs a single global table.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Introduction To Python' will help you establish a strong hold on all the fundamentals in the Python programming language. Below are the topics covered in this PPT:
Introduction To Python
Keywords And Identifiers
Variables And Data Types
Operators
Loops In Python
Functions
Classes And Objects
OOPS Concepts
File Handling
YouTube Video: https://youtu.be/uYjRzbP5aZs
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
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
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.
These are the slides I was using when delivering the Python Crash Course (https://www.meetup.com/life-michael/events/247984087/). The crash course was delivered in Hebrew. More info about the Python Programming course I deliver can be found at python.course.lifemichael.com.
This document provides an introduction and overview of the Python programming language. It discusses what Python is, its features, applications, and how to install Python on Windows and Linux systems. It also covers Python basics like variables, data types, operators, comments, conditional statements like if/else, and loops like for, while, and nested loops. Examples are provided for key concepts. The document is intended as a beginner tutorial for learning Python.
The document provides an introduction to Python programming including its features, uses, history, and installation process. Some key points covered include:
- Python is an interpreted, object-oriented programming language that is used for web development, scientific computing, and desktop applications.
- It was created by Guido van Rossum in 1991 and named after the Monty Python comedy group.
- To install Python on Windows, users download the latest version from python.org and run the installer, which also installs the IDLE development environment.
- The document then covers basic Python concepts like variables, data types, operators, and input/output functions.
This document provides an introduction to the Python programming language over 30 minutes. It covers basic Python concepts like variables, data types, conditionals, loops, functions, imports, strings, lists, tuples, sets, dictionaries, and classes. Code examples are provided to demonstrate how to use these features. The document encourages learners to continue learning Python through online documentation and resources.
The document provides an introduction to Python programming by discussing statements and syntax. It covers assignment statements, expression statements, print operations, conditional statements like if/else, and loop statements like while and for. It explains how Python programs are composed of modules containing statements with expressions. Truth tests for conditionals and built-in functions like range, zip that can be used in loops are also overviewed.
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.
This document provides an agenda and overview for a Python tutorial presented over multiple sessions. The first session introduces Python and demonstrates how to use the Python interpreter. The second session covers basic Python data structures like lists, modules, input/output, and exceptions. An optional third session discusses unit testing. The document explains that Python is an easy to learn yet powerful programming language that supports object-oriented programming and high-level data structures in an interpreted, dynamic environment.
In Python, data types define the type of data that can be stored and manipulated in variables. Python is a dynamically typed language, meaning you don't need to explicitly declare the data type of a variable; Python infers it based on the value assigned to the variable.
This document outlines the objectives and content of the course GE3151 Problem Solving and Python Programming. The course is intended to teach students the basics of algorithmic problem solving using Python. It covers topics like computational thinking, Python data types, control flow, functions, strings, lists, tuples, dictionaries, files and modules. The course contains 5 units that will teach students how to define problems, develop algorithms, implement solutions in Python using conditionals, loops, functions and data structures, perform input/output with files and use modules and packages.
This document provides an introduction and overview of the Python programming language course CSE 120 handled by G.Gandhi Jaba Kumar. It discusses that Python is an interpreted, object-oriented, and interactive programming language used for web development, software development, mathematics, and system scripting. The document then covers Python syntax including indentation, comments, keywords, variables, data types, operators, and basic programming concepts like conditionals and loops. It provides examples to illustrate Python code and best practices.
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.
This document provides an overview of the Python programming language. It discusses what Python is, its key features, who uses it, common applications, and how to download and install Python. It then covers Python syntax concepts like identifiers, keywords, multiline statements, docstrings, indentation, comments, and string formatting. The document also introduces Python data types like numbers, strings, lists, tuples, dictionaries, sets and how to work with them. It describes how to convert between number types and access/update strings and lists. Finally, it discusses Python development environments like Anaconda and Spyder.
This presentation is a great resource for zero-based Python programmers who wants to learn Python 3. This course includes brief history of Python and familiarity of its basic syntax.
Guido van Rossum emphasized the importance of code readability in Python. He introduced significant whitespace as a core feature of the language, aiming to enforce a clean and readable code structure. This emphasis on readability is evident in the presentation's mention of Python's design philosophy that highlights code readability.Van Rossum emphasized the importance of Python in enabling developers to write clear and logical code, which is scalable for both small and large-scale projects. The presentation mentions Python's language constructs and object-oriented approach designed to assist programmers in achieving this goal.
Though not explicitly attributed to van Rossum, Python's dynamically typed nature and built-in garbage collection contribute to its ease of use and simplification of memory management, reflecting the language's user-centric design principles.
Overall, Guido van Rossum's vision and design choices for Python resonate with the attributes and philosophies outlined in the presentation. His influence is seen in Python's core principles, which prioritize readability, versatility, and ease of use for programmers.
This document provides an introduction to Python programming concepts such as keywords, identifiers, comments, variables, data types, and literals. It defines keywords as reserved words in Python that have special meanings. Identifiers are names given to variables and other objects. Comments are notes for making code more readable. Variables are containers that hold data values. Literals represent fixed values like numbers and strings. The document also discusses Python data types like integers, floats, booleans, lists, tuples, dictionaries and sets.
This document provides an overview of Python programming in Katana for beginners. It discusses scripting languages and their advantages, different programming paradigms like procedural and object-oriented programming, and key Python concepts like data types, variables, functions, modules and packages. The document also demonstrates how to get started with Python in Katana, covering topics like syntax, comments, writing scripts and using the interactive console.
Python is a high-level, interpreted, interactive and object-oriented scripting language. It is designed to be highly readable using English keywords. Python is interpreted at runtime and does not require compilation. It supports both procedural and object-oriented programming. Python is beginner friendly and supports a wide range of applications. It is portable, extensible, and has a large standard library. Variables are dynamically typed and support integers, floating point numbers, complex numbers, strings, lists, tuples and dictionaries.
This document provides an introduction to Python programming. It discusses the history and origins of Python, why it is useful for programming, its core features like object-oriented programming and indentation, basic syntax like variables, data types, and keywords. It also covers strings, booleans, and how to assign values and combine text in strings.
This document provides an introduction to the Python programming language. It discusses Python language elements like literals, keywords, identifiers, operators, expressions, statements, and comments. It also covers Python data types, variables, printing values, and how to write and run a simple Python program. The document aims to explain Python concepts in a step-by-step manner to help readers learn the basics of the Python language.
This document discusses strings in Python. It begins by defining strings as sequences of characters that can be represented using single or double quotes. It then discusses some key reasons why strings are important in programming, including text representation, input/output handling, and text processing. It also covers string literals, operations like repetition, membership, slicing, and concatenation. Finally, it discusses some real-world applications of strings like spell checkers, search engines, and information retrieval systems.
This document summarizes a presentation on emerging technologies in computer science given by Subhrat Tripathi to Professor Mahesh Parmar. The presentation covered an introduction to the Python programming language, its features and basic syntax. It discussed that Python is an interpreted, interactive, object-oriented language that is easy to learn and read. The presentation also covered Python variables, lists, tuples, and dictionaries - the basic data structures. It provided examples of how to access, update, delete and slice elements of lists and tuples. In summary, the presentation provided an overview of the Python programming language for beginners.
Python (Data Analysis) cleaning and visualizeIruolagbePius
This document provides an overview of Python programming language. It discusses Python features, uses, variables, data types, operators, decision making statements, and loops. Specifically, it covers:
- Python features like being easy to learn and read, having an interactive mode, and being portable.
- Python variables, naming rules, and basic data types like numbers, strings, booleans.
- Operators for arithmetic, comparison, assignment, and logic.
- Conditional statements like if, elif, else for decision making.
- Looping structures like while and for loops, with examples of using break, continue, else, range().
- How to write comments, take user input, and
Python is a general-purpose programming language that is highly readable. It uses English keywords and has fewer syntactical constructions than other languages. Python supports object-oriented, interactive, and procedural programming. It has various data types like numbers, strings, lists, tuples and dictionaries. Python uses constructs like if/else, for loops, functions and classes to control program flow and structure code.
The document provides an introduction to Python programming and application development. It discusses that Python is an interpreted, high-level and object-oriented programming language. It then covers key Python concepts like data types, variables, operators, expressions and statements. The document also lists some common Python applications like data science, web development, AI and more.
This document provides an overview of the Python programming language in 3 paragraphs. It discusses that Python is a high-level, interpreted, interactive and object-oriented scripting language. It was created by Guido van Rossum in the late 1980s and derived from languages like C and C++. The document then covers some key features of Python, including that it is easy to learn and read, portable, extensible and supports object-oriented programming. It provides examples of Python's basic syntax including indentation, variables, data types, operators and more.
Python strings are sequences of characters that can be accessed and manipulated using various string methods. Strings can be declared using either single or double quotes and support escape characters. Strings are immutable and concatenation creates a new string. Common string methods include len() to get the length, lower()/upper() to case conversion, strip() to remove whitespace, and startswith()/endswith() to check substrings.
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".
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help boost feelings of calmness, happiness and focus.
This document appears to be a test for a course on Design and Analysis of Algorithms. The test contains 3 parts: Part A has 5 short answer questions defining key algorithm concepts; Part B has 2 longer questions, one on asymptotic notation and important problem types, the other explaining non-recursive analysis and computing a Fibonacci series recursively; Part C contains one question asking to explain recursive analysis of mathematics in brief. The test covers fundamental algorithm topics like complexity analysis, problem types, and recursive versus non-recursive analysis.
The document discusses binary tree representation and traversal methods. It provides two main representations of binary trees - array and linked representations. It also describes different types of binary trees like full, complete, left-skewed, and right-skewed trees. The document then explains three common traversal techniques for binary trees - inorder, preorder, and postorder traversals. Algorithms and code snippets are given for each traversal. Finally, applications of binary tree traversals are discussed along with expression trees and converting infix to postfix notation using a stack.
This document discusses dynamic programming algorithms and NP-completeness. It begins by outlining 12 steps for proving that a new problem Pnew is NP-complete. It then provides examples of reducing the clique problem to the independent set problem to show they are equivalent. The document explains the concepts of instances, solutions, validity and reductions. It shows how to reduce any NP problem to the circuit satisfiability problem by building a circuit VI(S) that is equivalent to checking if a solution S is valid for a given instance I.
The document discusses various optimization algorithms:
- Graph search algorithms like breadth-first search and Dijkstra's shortest path algorithm are used to find optimal paths in graphs.
- Depth-first search and linear ordering of partial orders are other graph algorithms covered.
- Network flows and linear programming are introduced as optimization problems where the goal is to find optimal solutions subject to constraints.
- Hill climbing and its application to the maximum flow problem in networks is also summarized.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMHODECEDSIET
Time Division Multiplexing (TDM) is a method of transmitting multiple signals over a single communication channel by dividing the signal into many segments, each having a very short duration of time. These time slots are then allocated to different data streams, allowing multiple signals to share the same transmission medium efficiently. TDM is widely used in telecommunications and data communication systems.
### How TDM Works
1. **Time Slots Allocation**: The core principle of TDM is to assign distinct time slots to each signal. During each time slot, the respective signal is transmitted, and then the process repeats cyclically. For example, if there are four signals to be transmitted, the TDM cycle will divide time into four slots, each assigned to one signal.
2. **Synchronization**: Synchronization is crucial in TDM systems to ensure that the signals are correctly aligned with their respective time slots. Both the transmitter and receiver must be synchronized to avoid any overlap or loss of data. This synchronization is typically maintained by a clock signal that ensures time slots are accurately aligned.
3. **Frame Structure**: TDM data is organized into frames, where each frame consists of a set of time slots. Each frame is repeated at regular intervals, ensuring continuous transmission of data streams. The frame structure helps in managing the data streams and maintaining the synchronization between the transmitter and receiver.
4. **Multiplexer and Demultiplexer**: At the transmitting end, a multiplexer combines multiple input signals into a single composite signal by assigning each signal to a specific time slot. At the receiving end, a demultiplexer separates the composite signal back into individual signals based on their respective time slots.
### Types of TDM
1. **Synchronous TDM**: In synchronous TDM, time slots are pre-assigned to each signal, regardless of whether the signal has data to transmit or not. This can lead to inefficiencies if some time slots remain empty due to the absence of data.
2. **Asynchronous TDM (or Statistical TDM)**: Asynchronous TDM addresses the inefficiencies of synchronous TDM by allocating time slots dynamically based on the presence of data. Time slots are assigned only when there is data to transmit, which optimizes the use of the communication channel.
### Applications of TDM
- **Telecommunications**: TDM is extensively used in telecommunication systems, such as in T1 and E1 lines, where multiple telephone calls are transmitted over a single line by assigning each call to a specific time slot.
- **Digital Audio and Video Broadcasting**: TDM is used in broadcasting systems to transmit multiple audio or video streams over a single channel, ensuring efficient use of bandwidth.
- **Computer Networks**: TDM is used in network protocols and systems to manage the transmission of data from multiple sources over a single network medium.
### Advantages of TDM
- **Efficient Use of Bandwidth**: TDM all
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
Unit 2 python
1. GE3151 – PROBLEM SOLVING AND
PYTHON PROGRAMMING
G.PRAVEENA
ASP/CSE
2. UNIT II DATA, EXPRESSIONS, STATEMENTS
Python interpreter and interactive mode; values
and types: int, float, boolean, string, and list;
variables, expressions, statements, tuple
assignment, precedence of operators,
comments; Illustrative programs: exchange the
values of two variables, circulate the values of n
variables, distance between two points.
3. INTRODUCTION TO PYTHON:
Python is a general-purpose interpreted,
interactive, object-oriented, and high-
level programming language.
It was created by Guido van Rossum during
1985- 1990.
Python got its name from “Monty Python’s
flying circus”. Python was released in the
year 2000.
4. v Python is interpreted: Python is
processed at runtime by the interpreter.
You do not need to compile your program
before executing it.
v Python is Interactive: You can actually sit
at a Python prompt and interact with the
interpreter directly to write your programs.
5. Python is Object-Oriented: Python supports
Object-Oriented style or technique of
programming that encapsulates code within
objects.
v Python is a Beginner's Language: Python
is a great language for the beginner- level
programmers and supports the development
of a wide range of applications.
6. Python Features:
v Easy-to-learn: Python is clearly defined and easily
readable. The structure of the program is very simple. It uses
few keywords.
v Easy-to-maintain: Python's source code is fairly easy-to-
maintain.
v Portable: Python can run on a wide variety of
hardware platforms and has the same interface on all
platforms.
v Interpreted: Python is processed at runtime by the
interpreter. So, there is no need to compile a program before
executing it. You can simply run the program.
7. Extensible: Programmers can embed python within their
C,C++,Java script ,ActiveX, etc.
v Free and Open Source: Anyone can freely distribute it,
read the source code, and edit it.
v High Level Language: When writing programs,
programmers concentrate on solutions of the current
problem, no need to worry about the low level details.
v Scalable: Python provides a better structure and support
for large programs than shell scripting.
8. Applications
v Bit Torrent file sharing
v Google search engine, Youtube
v Intel, Cisco, HP, IBM
v i–Robot
v NASA
v Facebook, Drop box
9. Python interpreter:
Interpreter: To execute a program in a high-
level language by translating it one line at a
time.
Compiler: To translate a program written in a
high-level language into a low-level language
all at once, in preparation for later execution.
10.
11. MODES OF PYTHON INTERPRETER:
Python Interpreter is a program that reads
and executes Python code. It uses 2 modes of
Execution.
1. Interactive mode
2. Script mode
12. 1. Interactive mode:
v Interactive Mode, as the name suggests, allows us to
interact with OS.
v When we type Python statement, interpreter displays
the result(s) immediately.
Advantages:
v Python, in interactive mode, is good enough to learn,
experiment or explore.
v Working in interactive mode is convenient for beginners
and for testing small pieces of code.
13. Drawback:
v We cannot save the statements and have to retype all the statements
once again to re-run them.
In interactive mode, you type Python programs and the interpreter
displays the result:
>>> 1 + 1
2
The chevron, >>>, is the prompt the interpreter uses to indicate that it is
ready for you to enter code. If you type 1 + 1, the interpreter replies 2.
>>> print ('Hello, World!')
Hello, World!
14.
15. 2. Script mode:
v In script mode, we type python program in
a file and then use interpreter to execute the
content of the file.
v Scripts can be saved to disk for future
use. Python scripts have the extension .py,
meaning that the filename ends with .py
16.
17. Integrated Development Learning Environment (IDLE):
v Is a graphical user interface which is completely written
in Python.
v It is bundled with the default implementation of the
python language and also comes with optional part of the
Python packaging.
Features of IDLE:
Multi-window text editor with syntax highlighting.
v Auto completion with smart indentation.
Python shell to display output with syntax highlighting.
18. VALUES AND DATA TYPES
Value:
Value can be any letter ,number or string.
Eg, Values are 2, 42.0, and 'Hello, World!'.
(These values belong to different datatypes.)
Data type:
• Every value in Python has a data type.
• It is a set of values, and the allowable
operations on those values.
19.
20. Numbers:
Number data type stores Numerical Values.
This data type is immutable [i.e. values/items
cannot be changed].
Python supports integers, floating point
numbers and complex numbers. They are
defined as,
21.
22. Sequence:
A sequence is an ordered collection of items, indexed by
positive integers.
It is a combination of mutable (value can be changed) and
immutable (values cannot be changed) data types.
There are three types of sequence data type available in
Python, they are
1. Strings
2. Lists
3. Tuples
23. • Strings
A String in Python consists of a series or sequence of
characters - letters, numbers, and special characters.
Strings are marked by quotes:
single quotes (' ') Eg, 'This a string in single quotes'
double quotes (" ") Eg, "'This a string in double quotes'"
triple quotes(""" """) Eg, This is a paragraph. It is
made up of multiple lines and sentences."""
Individual character in a string is accessed using a
subscript (index).
Characters can be accessed using indexing and slicing
operations
• Strings are immutable i.e. the contents of the string cannot
be changed after it is created.
24. Indexing:
Positive indexing helps in accessing the string from the beginning
· Negative subscript helps in accessing the string from the
end.
· Subscript 0 or –ve n(where n is length of the string)
displays the first element.
Example: A[0] or A[-5] will display “H”
· Subscript 1 or –ve (n-1) displays the second element.
Example: A[1] or A[-4] will display “E”
25. Operations on string:
i. Indexing
ii. Slicing
iii. Concatenation
iv. Repetitions
v. Member ship
26.
27. 2. Lists
v List is an ordered sequence of items. Values
in the list are called elements / items.
v It can be written as a list of comma-
separated items (values)
between square brackets[ ].
v Items in the lists can be of different data
types.
30. 3. Tuple:
v A tuple is same as list, except that the set of elements
is enclosed in parentheses instead of square brackets.
v A tuple is an immutable list. i.e. once a tuple has been
created, you can't add elements to a tuple or remove elements
from the tuple.
v Benefit of Tuple:
v Tuples are faster than lists.
v If the user wants to protect the data from accidental
changes, tuple can be used.
v Tuples can be used as keys in dictionaries, while lists
can't.
32. Altering the tuple data type leads to
error. Following error occurs when user tries
to do.
>>> t[0]="a"
Trace back (most recent call last):
File "<stdin>", line 1, in <module>
Type Error: 'tuple' object does not support
item assignment
34. Dictionaries:
v Lists are ordered sets of objects, whereas dictionaries are
unordered sets.
v Dictionary is created by using curly brackets. i,e. {}
v Dictionaries are accessed via keys and not via their position.
v A dictionary is an associative array (also known as hashes). Any key of
the dictionary is associated (or mapped) to a value.
v The values of a dictionary can be any Python data type. So dictionaries
are
unordered key-value-pairs(The association of a key and a value is called
a key-value pair )
Dictionaries don't support the sequence operation of the sequence data
types like strings, tuples and lists.
35.
36. If you try to access a key which doesn't exist,
you will get an error message:
>>> words = {"house" : "Haus", "cat":"Katze"}
>>> words["car"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'car'
37.
38. VARIABLES:
v A variable allows us to store a value by
assigning it to a name, which can be used later.
v Named memory locations to store values.
v Programmers generally choose names for
their variables that are meaningful.
v It can be of any length. No space is allowed.
v We don't need to declare a variable before
using it. In Python, we simply assign a value to
a variable and it will exist.
39. Assigning value to variable:
Value should be given on the right side of assignment
operator(=) and variable on left side.
>>>counter =45
print(counter)
Assigning a single value to several variables simultaneously:
>>> a=b=c=100
Assigning multiple values to multiple variables:
>>> a,b,c=2,4,"ram"
40. KEYWORDS:
v Keywords are the reserved words in
Python.
v We cannot use a keyword as variable
name, function name or any other identifier.
v They are used to define the syntax and
structure of the Python language.
v Keywords are case sensitive.
41.
42. IDENTIFIERS:
Identifier is the name given to entities like class,
functions, variables etc. in Python.
v Identifiers can be a combination of letters in lowercase (a
to z) or uppercase (A to Z) or digits (0 to 9) or an underscore
(_).
v all are valid example.
v An identifier cannot start with a digit.
v Keywords cannot be used as identifiers.
v Cannot use special symbols like !, @, #, $, % etc. in our
identifier.
v Identifier can be of any length.
44. STATEMENTS AND EXPRESSIONS:
Statements:
-Instructions that a Python interpreter can executes are
called statements.
-A statement is a unit of code like creating a variable or
displaying a value.
>>> n = 17
>>> print(n)
Here, The first line is an assignment statement that gives a
value to n.
The second line is a print statement that displays the value
of n.
45. Expressions:
-An expression is a combination of values, variables, and operators.
-A value all by itself is considered an expression, and also a variable.
So the following are all legal expressions:
>>> 42
42
>>> a=2
>>> a+3+2
7
>>> z=("hi"+"friend")
>>> print(z)
Hifriend
46. INPUT AND OUTPUT
INPUT: Input is data entered by user (end user) in the
program.
In python, input () function is available for input.
Syntax for input() is:
variable = input (“data”)
Example:
>>> x=input("enter the name:") enter the name: george
>>>y=int(input("enter the number"))
enter the number 3
#python accepts string as default data type. conversion is
required for type.
47. OUTPUT: Output can be displayed to the user
using Print statement .
Syntax:
print (expression/constant/variable)
Example:
print ("Hello") Hello
48. COMMENTS:
v A hash sign (#) is the beginning of a comment.
v Anything written after # in a line is ignored by interpreter.
Eg:percentage = (minute * 100) / 60 # calculating percentage of an
hour
v Python does not have multiple-line commenting feature. You have
to
comment each line individually as follows :
Example:
# This is a comment.
# This is a comment, too.
# I said that already.
49. LINES AND INDENTATION:
v Most of the programming languages like C,
C++, Java use braces { } to define a block of
code. But, python uses indentation.
v Blocks of code are denoted by line
indentation.
v It is a space given to the block of codes for
class and function definitions or flow control.
51. QUOTATION IN PYTHON:
Python accepts single ('), double (") and triple (''' or """)
quotes to denote string literals.
Anything that is represented using quotations are considered
as string.
v single quotes (' ') Eg, 'This a string in single quotes'
v double quotes (" ") Eg, "'This a string in double quotes'"
v triple quotes(""" """) Eg, This is a paragraph. It is made
up of multiple lines and sentences."""
52. TUPLE ASSIGNMENT
v An assignment to all of the elements in a tuple using a
single assignment statement.
v Python has a very powerful tuple assignment feature
that allows a tuple of variables on the left of an assignment to
be assigned values from a tuple on the right of the
assignment.
v The left side is a tuple of variables; the right side is a tuple
of values.
•v Each value is assigned to its respective
variable.
53. v All the expressions on the right side are
evaluated before any of the assignments. This
feature makes tuple assignment quite
versatile.
v Naturally, the number of variables on
the left and the number of values on the
right have to be the same.
>>> (a, b, c, d) = (1, 2, 3)
ValueError: need more than 3 values to
unpack
54. Example:
-It is useful to swap the values of two variables.
With conventional assignment statements, we have to use
a temporary variable. For example, to swap a and b:
Swap two numbers
a=2;b=3
print(a,b)
temp = a
a = b
b = temp
print(a,b)
56. One way to think of tuple assignment is as tuple
packing/unpacking.
In tuple packing, the values on the left are ‘packed’
together in a tuple:
>>> b = ("George", 25, "20000") # tuple packing
-In tuple unpacking, the values in a tuple on the
right are ‘unpacked’ into the variables/names on
the right:
>>> b = ("George", 25, "20000") # tuple packing
>>> (name, age, salary) = b # tuple unpacking
58. Example:
-To split an email address in to user name and
a domain
>>> mailid='god@abc.org'
>>> name,domain=mailid.split('@')
>>> print name
god
print (domain)
abc.org
59. OPERATORS:
v Operators are the constructs which
can manipulate the value of operands.
v Consider the expression 4 + 5 =
9. Here, 4 and 5 are called
operands and + is called operator
60. Types of Operators:
-Python language supports the following
types of operators
Arithmetic Operators
Comparison (Relational) Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
61. Arithmetic operators:
• They are used to perform mathematical
operations like addition, subtraction,
multiplication etc. Assume, a=10 and b=5
65. Comparison (Relational) Operators:
Comparison operators are used to
compare values.
It either returns True or False according to
the condition. Assume, a=10 and b=5
71. Example
a = 21
b = 10
c = 0
c = a + b
print("Line 1 - Value of c is ", c)
c += a
print("Line 2 - Value of c is ", c)
c *= a
print("Line 3 - Value of c is ", c)
c /= a
print("Line 4 - Value of c is ", c)
c= 2 c %= a
print("Line 5 - Value of c is ", c) c **= a
print("Line 6 - Value of c is ", c) c //= a
print("Line 7 - Value of c is ", c)
72. Output
Line 1 - Value of c is 31
Line 2 - Value of c is 52
Line 3 - Value of c is 1092
Line 4 - Value of c is 52.0
Line 5 - Value of c is 2
Line 6 - Value of c is 2097152
Line 7 - Value of c is 99864
74. Example
a = True
b = False
print('a and b is',a and b)
print('a or b is',a or b)
print('not a is',not a)
Output
x and y is False
x or y is True
not x is False
75. Bitwise Operators:
A bitwise operation operates on one or
more bit patterns at the level of individual Bits
Example:
Let x = 10 (0000 1010 in binary) and
y = 4 (0000 0100 in binary)
76.
77. Example
a = 60 # 60 = 0011 1100
b = 13 # 13 = 0000 1101
c = 0
c = a & b; # 12 = 0000 1100
print "Line 1 - Value of c is ", c
c = a | b; # 61 = 0011 1101
print "Line 2 - Value of c is ", c
c = a ^ b; # 49 = 0011 0001
print "Line 3 - Value of c is ", c
c = ~a; # -61 = 1100 0011
print "Line 4 - Value of c is ", c
c = a << 2; # 240 = 1111 0000
print "Line 5 - Value of c is ", c
c = a >> 2; # 15 = 0000 1111
print "Line 6 - Value of c is ", c
78. Output
Line 1 - Value of c is 12
Line 2 - Value of c is 61
Line 3 - Value of c is 49
Line 4 - Value of c is -61
Line 5 - Value of c is 240
Line 6 - Value of c is 15
79. Membership Operators:
v Evaluates to find a value or a variable is in
the specified sequence of string, list, tuple,
dictionary or not.
v Let, x=[5,3,6,4,1]. To check particular item
in list or not, in and not in operators are
used.
81. Identity Operators
• They are used to check if two values (or
variables) are located on the same part of
the memory.
82. Example
x = 5
y = 5
x2 = 'Hello'
y2 = 'Hello'
print(x1 is not y1)
print(x2 is y2)
Output
False
True
83. OPERATOR PRECEDENCE:
• When an expression contains more than
one operator, the order of
evaluation depends on the order of
operations.
84.
85. -For mathematical operators, Python follows mathematical
convention.
-The acronym PEMDAS (Parentheses, Exponentiation,
Multiplication, Division, Addition, Subtraction) is a useful way
to remember the rules:
v Parentheses have the highest precedence and can be
used to force an expression to evaluate in the order you want.
Since expressions in parentheses are evaluated first, 2 * (3-
1)is 4, and (1+1)**(5-2) is 8.
v You can also use parentheses to make an expression
easier to read, as in (minute * 100) / 60, even if it doesn’t
change the result.
86. v Exponentiation has the next highest
precedence, so 1 + 2**3 is 9, not 27, and 2
*3**2 is 18, not 36.
v Multiplication and Division have higher
precedence than Addition and Subtraction. So
2*3-1 is 5, not 4, and 6+4/2 is 8, not 5.
v Operators with the same precedence are
evaluated from left to right (except
exponentiation).
91. ILLUSTRATIVE PROGRAMS
Program for SWAPPING(Exchanging )of values
a = int(input("Enter a value "))
b = int(input("Enter b value "))
c = a
a = b
b = c
print("a=",a,"b=",b,)
Output
Enter a value 5
Enter b value 8
a=8
b=5
92. Program to find distance between two points
import math
x1=int(input("enter x1"))
y1=int(input("enter y1"))
x2=int(input("enter x2"))
y2=int(input("enter y2"))
distance =math.sqrt((x2-x1)**2)+((y2-
y1)**2)
print(distance)
Output
enter x1 7
enter y1 6
enter x2 5
enter y2 7
2.5
93. Program to circulate n numbers
a=list(input("enter the list"))
print(a)
for i in range(1,len(a),1):
print(a[i:]+a[:i])
Output:
enter the list '1234'
['1', '2', '3', '4']
['2', '3', '4', '1']
['3', '4', '1', '2']
['4', '1', '2', '3']