The document provides an introduction to the Python programming language. It discusses that Python was created by Guido Van Rossum in 1991 and was named after the Monty Python comedy troupe. Python is an open source, interpreted language that can be used for both procedural and object-oriented programming. It has a simple syntax and supports features like graphical user interfaces, integration with other languages, and is used widely in applications like web development, artificial intelligence, and data science. The document also covers Python concepts like variables, data types, operators, input/output and comments.
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 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.
The document provides an introduction to Python programming. It discusses that Python is a high-level, interpreted, object-oriented, and general purpose programming language. It can be used for web development, scientific computing, desktop applications, and more. The document then covers Python basics like data types, variables, literals, operators, control flow statements, functions, modules and packages. It also discusses installing Python on Windows and writing the first Python program.
This document discusses Python data types and variables. It covers numeric data types like int and float, as well as Boolean, string, and sequence data types. It also defines what a variable is, how to name variables, and how to print and update variable values. It introduces type casting and the input function for getting user input.
Python is an interpreted, object-oriented, high-level programming language with dynamic typing and dynamic binding. Its simple, easy to learn syntax emphasizes readability and it uses significant indentation to delimit code blocks rather than curly braces or keywords. Python supports modules and packages, which encourages program modularity and code reuse. It also has a large standard library.
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.
Python can be used for a variety of applications including web development, scientific computing, education, desktop GUIs, and software development. It is commonly used to build web applications using frameworks like Django and Flask, for scientific computing tasks using libraries like NumPy and SciPy, and for general software development tasks like build automation and testing. Python supports a range of data types including integers, floats, complex numbers, lists, dictionaries, sets, and strings. It can be used to write functions and programs to solve problems across many domains.
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 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.
The document provides an introduction to Python programming. It discusses that Python is a high-level, interpreted, object-oriented, and general purpose programming language. It can be used for web development, scientific computing, desktop applications, and more. The document then covers Python basics like data types, variables, literals, operators, control flow statements, functions, modules and packages. It also discusses installing Python on Windows and writing the first Python program.
This document discusses Python data types and variables. It covers numeric data types like int and float, as well as Boolean, string, and sequence data types. It also defines what a variable is, how to name variables, and how to print and update variable values. It introduces type casting and the input function for getting user input.
Python is an interpreted, object-oriented, high-level programming language with dynamic typing and dynamic binding. Its simple, easy to learn syntax emphasizes readability and it uses significant indentation to delimit code blocks rather than curly braces or keywords. Python supports modules and packages, which encourages program modularity and code reuse. It also has a large standard library.
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.
Python can be used for a variety of applications including web development, scientific computing, education, desktop GUIs, and software development. It is commonly used to build web applications using frameworks like Django and Flask, for scientific computing tasks using libraries like NumPy and SciPy, and for general software development tasks like build automation and testing. Python supports a range of data types including integers, floats, complex numbers, lists, dictionaries, sets, and strings. It can be used to write functions and programs to solve problems across many domains.
The document discusses algorithms and problem solving using Python. It defines an algorithm as a step-by-step procedure to get a desired output. Characteristics of algorithms include being unambiguous, having well-defined inputs and outputs, and terminating after a finite number of steps. The document provides an example algorithm to add two numbers and displays the result. It also discusses flowcharts, keywords, identifiers, data types like integers and strings, and data structures in Python like lists and dictionaries.
This document provides an introduction and overview of the C programming language. It discusses the basic structure of a C program including preprocessor directives, global declarations, functions, and statements. It also covers fundamental C concepts such as variable declarations, data types, constants, comments, and input/output functions. The history and evolution of C from earlier languages like ALGOL and BCPL is presented.
This document provides an introduction and overview of the C programming language. It discusses the basic structure of a C program including preprocessor directives, global declarations, functions, and statements. It also covers fundamental C concepts such as variable declarations, data types, constants, comments, and input/output functions. The history and evolution of C from earlier languages like ALGOL and BCPL is presented.
This document provides an introduction and overview of the C programming language. It begins with a basic "Hello World" program and outlines the main components of a C program including preprocessor directives, functions, variables, data types, input/output, and comments. It also provides history on the development of C and describes the structure of C programs and key elements like functions, main functions, and comments.
A File is a collection of data stored in the secondary memory. So far data wa...bhargavi804095
A File is a collection of data stored in the secondary memory. So far data was entered into the programs through the keyboard. So Files are used for storing information that can be processed by the programs. Files are not only used for storing the data, programs are also stored in files. In order to use files, we have to learn file input and output operations. That is, how data is read and how to write into a file. A Stream is the important concept in C. The Stream is a common, logical interface to the various devices that comprise the computer. So a Stream is a logical interface to a file. There are two types of Streams, Text Stream and Binary Stream. A Text File can be thought of as a stream of characters that can be processed sequentially. It can only be processed in the forward direction.
Values in Python can belong to different data types including numbers, strings, and lists. Numbers include integers, floating point numbers, and complex numbers. Strings are a sequence of characters that can be defined using single quotes, double quotes, or triple quotes. Common data types in Python include numbers, strings, lists, tuples, and dictionaries. Lists are mutable sequences while tuples are immutable sequences.
Python is an interpreted, interactive, object-oriented programming language. It has a simple syntax and is used for rapid application development. Python supports procedural, object-oriented, and functional programming. It has a large standard library and can connect to existing components. Python is easy to read and maintain due to its clear syntax and structure. It is also portable and has broad library support.
- The document discusses Python programming concepts such as data types, variables, operators, and syntax. It provides examples of Python code for variables, comments, strings, numbers, and more.
- Python is a popular programming language used for web development, software development, mathematics, and more. It runs on different platforms and has a simple, readable syntax.
- Key features of Python include dynamic typing, automatic memory management, and an intuitive syntax that uses indentation rather than brackets.
The document provides an overview of the basics of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented scripting language. It also covers Python's history and describes it as being easy to learn and read, easy to maintain, portable, and extensible. The document then details Python's core data types including numbers, strings, lists, tuples, and dictionaries. It provides examples of how to define and manipulate variables of each data type in Python.
C++ is an object-oriented programming language that is based on C and adds object-oriented programming features like classes, inheritance, and polymorphism. It was created by Bjarne Stroustrup at Bell Labs in the early 1980s. The document provides an introduction to C++ including its history, differences from C, program structure, data types, variables, input/output, and integrated development environments.
The document discusses the Python programming language. It describes Python as a popular programming language created by Guido van Rossum in 1991. It is commonly used for web development, software development, mathematics, and system scripting. The document then provides further details on Python syntax, including how Python uses indentation to define scope rather than curly brackets, and how it supports variables, data types, comments, and global versus local variables. It also encourages practicing Python through examples in the command line and .py files.
This document provides an overview of Java keywords, primitive data types, wrapper classes, variables, expressions, comments, casting, and overflow. It discusses the 50 Java keywords like abstract and boolean. It describes the 8 primitive types (boolean, char, byte, short, int, long, float, double), their ranges, and literals. It introduces the wrapper classes that correspond to each primitive type, like Integer for int. It also covers variables, expressions, single-line and multi-line comments, identity/widening/narrowing conversions during casting, and how overflow is handled for integer vs floating-point values.
This document discusses Java variables, data types, and operators. It covers the basics of declaring variables in Java, including primitive and non-primitive data types. It also describes different types of variables, literals, casting, and operators such as arithmetic, assignment, comparison, and logical operators. Examples are provided to demonstrate variable declaration and usage of various operators.
This document provides an overview of key concepts in Python including:
- Python is a dynamically typed language where variables are not explicitly defined and can change type.
- Names and identifiers in Python are case sensitive and follow specific conventions.
- Python uses indentation rather than brackets to define blocks of code.
- Core data types in Python include numeric, string, list, tuple, dictionary, set, boolean and file types. Each has specific characteristics and operators.
Variables, constants, I/O functions & Header Files document discusses:
1. Variables in C - Variables store data in memory locations and can change value. They are declared with a data type and name.
2. Constants in C - Constants cannot change value once declared. They include integer, floating point, character, and string literals.
3. Input/output functions in C - These allow programs to accept input and display output. Formatted functions like printf() and scanf() control formatting while unformatted functions like getch() and putch() do not.
4. Header files in C - Header files contain predefined library functions and are included using #include to access standard functions.
The document discusses various data types in Python including float, complex, bool, and str (string) types. It provides details on how each data type stores and represents values. For float, it notes they have a precision of 16 digits and can be represented exponentially. Complex numbers are written as x + yj. Bool only allows True or False values. Strings use Unicode encoding and can be delimited by either single or double quotes, using escape characters when needed. It also discusses accessing individual characters within a string using indexes.
Python is a cross-platform programming language that can run on Windows, macOS, Linux, and other platforms. It is free and open-source. While most modern operating systems come with Python pre-installed, it is generally recommended to install the latest version separately. The Thonny IDE is a simple Python IDE that bundles the latest Python version, so it can run Python programs without requiring a separate Python installation. Thonny has features like an easy-to-use debugger and code completion that make it suitable for beginners learning Python.
This document provides information on variables, data types, and keywords in C# programming. It discusses the differences between static and normal variables, with static variables allocating memory in the class and maintaining their value until the application closes. Different data types are described like integral, floating point, and nullable types. Value, reference, and pointer data types are also explained. The document contains code examples demonstrating static and normal variables as well as printing the limits of different data types. Keywords in C# that cannot be used as identifiers are listed.
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.
Unlocking the Secrets to Safe Patient Handling.pdfLift Ability
Furthermore, the time constraints and workload in healthcare settings can make it challenging for caregivers to prioritise safe patient handling Australia practices, leading to shortcuts and increased risks.
The document discusses algorithms and problem solving using Python. It defines an algorithm as a step-by-step procedure to get a desired output. Characteristics of algorithms include being unambiguous, having well-defined inputs and outputs, and terminating after a finite number of steps. The document provides an example algorithm to add two numbers and displays the result. It also discusses flowcharts, keywords, identifiers, data types like integers and strings, and data structures in Python like lists and dictionaries.
This document provides an introduction and overview of the C programming language. It discusses the basic structure of a C program including preprocessor directives, global declarations, functions, and statements. It also covers fundamental C concepts such as variable declarations, data types, constants, comments, and input/output functions. The history and evolution of C from earlier languages like ALGOL and BCPL is presented.
This document provides an introduction and overview of the C programming language. It discusses the basic structure of a C program including preprocessor directives, global declarations, functions, and statements. It also covers fundamental C concepts such as variable declarations, data types, constants, comments, and input/output functions. The history and evolution of C from earlier languages like ALGOL and BCPL is presented.
This document provides an introduction and overview of the C programming language. It begins with a basic "Hello World" program and outlines the main components of a C program including preprocessor directives, functions, variables, data types, input/output, and comments. It also provides history on the development of C and describes the structure of C programs and key elements like functions, main functions, and comments.
A File is a collection of data stored in the secondary memory. So far data wa...bhargavi804095
A File is a collection of data stored in the secondary memory. So far data was entered into the programs through the keyboard. So Files are used for storing information that can be processed by the programs. Files are not only used for storing the data, programs are also stored in files. In order to use files, we have to learn file input and output operations. That is, how data is read and how to write into a file. A Stream is the important concept in C. The Stream is a common, logical interface to the various devices that comprise the computer. So a Stream is a logical interface to a file. There are two types of Streams, Text Stream and Binary Stream. A Text File can be thought of as a stream of characters that can be processed sequentially. It can only be processed in the forward direction.
Values in Python can belong to different data types including numbers, strings, and lists. Numbers include integers, floating point numbers, and complex numbers. Strings are a sequence of characters that can be defined using single quotes, double quotes, or triple quotes. Common data types in Python include numbers, strings, lists, tuples, and dictionaries. Lists are mutable sequences while tuples are immutable sequences.
Python is an interpreted, interactive, object-oriented programming language. It has a simple syntax and is used for rapid application development. Python supports procedural, object-oriented, and functional programming. It has a large standard library and can connect to existing components. Python is easy to read and maintain due to its clear syntax and structure. It is also portable and has broad library support.
- The document discusses Python programming concepts such as data types, variables, operators, and syntax. It provides examples of Python code for variables, comments, strings, numbers, and more.
- Python is a popular programming language used for web development, software development, mathematics, and more. It runs on different platforms and has a simple, readable syntax.
- Key features of Python include dynamic typing, automatic memory management, and an intuitive syntax that uses indentation rather than brackets.
The document provides an overview of the basics of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented scripting language. It also covers Python's history and describes it as being easy to learn and read, easy to maintain, portable, and extensible. The document then details Python's core data types including numbers, strings, lists, tuples, and dictionaries. It provides examples of how to define and manipulate variables of each data type in Python.
C++ is an object-oriented programming language that is based on C and adds object-oriented programming features like classes, inheritance, and polymorphism. It was created by Bjarne Stroustrup at Bell Labs in the early 1980s. The document provides an introduction to C++ including its history, differences from C, program structure, data types, variables, input/output, and integrated development environments.
The document discusses the Python programming language. It describes Python as a popular programming language created by Guido van Rossum in 1991. It is commonly used for web development, software development, mathematics, and system scripting. The document then provides further details on Python syntax, including how Python uses indentation to define scope rather than curly brackets, and how it supports variables, data types, comments, and global versus local variables. It also encourages practicing Python through examples in the command line and .py files.
This document provides an overview of Java keywords, primitive data types, wrapper classes, variables, expressions, comments, casting, and overflow. It discusses the 50 Java keywords like abstract and boolean. It describes the 8 primitive types (boolean, char, byte, short, int, long, float, double), their ranges, and literals. It introduces the wrapper classes that correspond to each primitive type, like Integer for int. It also covers variables, expressions, single-line and multi-line comments, identity/widening/narrowing conversions during casting, and how overflow is handled for integer vs floating-point values.
This document discusses Java variables, data types, and operators. It covers the basics of declaring variables in Java, including primitive and non-primitive data types. It also describes different types of variables, literals, casting, and operators such as arithmetic, assignment, comparison, and logical operators. Examples are provided to demonstrate variable declaration and usage of various operators.
This document provides an overview of key concepts in Python including:
- Python is a dynamically typed language where variables are not explicitly defined and can change type.
- Names and identifiers in Python are case sensitive and follow specific conventions.
- Python uses indentation rather than brackets to define blocks of code.
- Core data types in Python include numeric, string, list, tuple, dictionary, set, boolean and file types. Each has specific characteristics and operators.
Variables, constants, I/O functions & Header Files document discusses:
1. Variables in C - Variables store data in memory locations and can change value. They are declared with a data type and name.
2. Constants in C - Constants cannot change value once declared. They include integer, floating point, character, and string literals.
3. Input/output functions in C - These allow programs to accept input and display output. Formatted functions like printf() and scanf() control formatting while unformatted functions like getch() and putch() do not.
4. Header files in C - Header files contain predefined library functions and are included using #include to access standard functions.
The document discusses various data types in Python including float, complex, bool, and str (string) types. It provides details on how each data type stores and represents values. For float, it notes they have a precision of 16 digits and can be represented exponentially. Complex numbers are written as x + yj. Bool only allows True or False values. Strings use Unicode encoding and can be delimited by either single or double quotes, using escape characters when needed. It also discusses accessing individual characters within a string using indexes.
Python is a cross-platform programming language that can run on Windows, macOS, Linux, and other platforms. It is free and open-source. While most modern operating systems come with Python pre-installed, it is generally recommended to install the latest version separately. The Thonny IDE is a simple Python IDE that bundles the latest Python version, so it can run Python programs without requiring a separate Python installation. Thonny has features like an easy-to-use debugger and code completion that make it suitable for beginners learning Python.
This document provides information on variables, data types, and keywords in C# programming. It discusses the differences between static and normal variables, with static variables allocating memory in the class and maintaining their value until the application closes. Different data types are described like integral, floating point, and nullable types. Value, reference, and pointer data types are also explained. The document contains code examples demonstrating static and normal variables as well as printing the limits of different data types. Keywords in C# that cannot be used as identifiers are listed.
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.
Similaire à Chapter7-Introduction to Python.pptx (20)
Unlocking the Secrets to Safe Patient Handling.pdfLift Ability
Furthermore, the time constraints and workload in healthcare settings can make it challenging for caregivers to prioritise safe patient handling Australia practices, leading to shortcuts and increased risks.
Michigan HealthTech Market Map 2024. Includes 7 categories: Policy Makers, Academic Innovation Centers, Digital Health Providers, Healthcare Providers, Payers / Insurance, Device Companies, Life Science Companies, Innovation Accelerators. Developed by the Michigan-Israel Business Accelerator
Hypertension and it's role of physiotherapy in it.Vishal kr Thakur
This particular slides consist of- what is hypertension,what are it's causes and it's effect on body, risk factors, symptoms,complications, diagnosis and role of physiotherapy in it.
This slide is very helpful for physiotherapy students and also for other medical and healthcare students.
Here is summary of hypertension -
Hypertension, also known as high blood pressure, is a serious medical condition that occurs when blood pressure in the body's arteries is consistently too high. Blood pressure is the force of blood pushing against the walls of blood vessels as the heart pumps it. Hypertension can increase the risk of heart disease, brain disease, kidney disease, and premature death.
The best massage spa Ajman is Chandrima Spa Ajman, which was founded in 2023 and is exclusively for men 24 hours a day. As of right now, our parent firm has been providing massage services to over 50,000+ clients in Ajman for the past 10 years. It has about 8+ branches. This demonstrates that Chandrima Spa Ajman is among the most reasonably priced spas in Ajman and the ideal place to unwind and rejuvenate. We provide a wide range of Spa massage treatments, including Indian, Pakistani, Kerala, Malayali, and body-to-body massages. Numerous massage techniques are available, including deep tissue, Swedish, Thai, Russian, and hot stone massages. Our massage therapists produce genuinely unique treatments that generate a revitalized sense of inner serenely by fusing modern techniques, the cleanest natural substances, and traditional holistic therapists.
Healthy Eating Habits:
Understanding Nutrition Labels: Teaches how to read and interpret food labels, focusing on serving sizes, calorie intake, and nutrients to limit or include.
Tips for Healthy Eating: Offers practical advice such as incorporating a variety of foods, practicing moderation, staying hydrated, and eating mindfully.
Benefits of Regular Exercise:
Physical Benefits: Discusses how exercise aids in weight management, muscle and bone health, cardiovascular health, and flexibility.
Mental Benefits: Explains the psychological advantages, including stress reduction, improved mood, and better sleep.
Tips for Staying Active:
Encourages consistency, variety in exercises, setting realistic goals, and finding enjoyable activities to maintain motivation.
Maintaining a Balanced Lifestyle:
Integrating Nutrition and Exercise: Suggests meal planning and incorporating physical activity into daily routines.
Monitoring Progress: Recommends tracking food intake and exercise, regular health check-ups, and provides tips for achieving balance, such as getting sufficient sleep, managing stress, and staying socially active.
Comprehensive Rainy Season Advisory: Safety and Preparedness Tips.pdfDr Rachana Gujar
The "Comprehensive Rainy Season Advisory: Safety and Preparedness Tips" offers essential guidance for navigating rainy weather conditions. It covers strategies for staying safe during storms, flood prevention measures, and advice on preparing for inclement weather. This advisory aims to ensure individuals are equipped with the knowledge and resources to handle the challenges of the rainy season effectively, emphasizing safety, preparedness, and resilience.
R3 Stem Cell Therapy: A New Hope for Women with Ovarian FailureR3 Stem Cell
Discover the groundbreaking advancements in stem cell therapy by R3 Stem Cell, offering new hope for women with ovarian failure. This innovative treatment aims to restore ovarian function, improve fertility, and enhance overall well-being, revolutionizing reproductive health for women worldwide.
MBC Support Group for Black Women – Insights in Genetic Testing.pdfbkling
Christina Spears, breast cancer genetic counselor at the Ohio State University Comprehensive Cancer Center, joined us for the MBC Support Group for Black Women to discuss the importance of genetic testing in communities of color and answer pressing questions.
COPD Treatment in Ghatkopar,Mumbai. Dr Kumar DoshiDr Kumar Doshi
Are you or a loved one affected by Chronic Obstructive Pulmonary Disease (COPD)? Discover comprehensive and advanced treatment options with Dr. Kumar Doshi, a preeminent COPD specialist based in Ghatkopar, Mumbai.
Dr. Kumar Doshi is dedicated to delivering the highest standard of care for COPD patients. Whether you are seeking a diagnosis, a second opinion, or exploring new treatment avenues, this presentation will guide you through the exceptional services available at his practice in Ghatkopar, Mumbai.
Letter to MREC - application to conduct studyAzreen Aj
Application to conduct study on research title 'Awareness and knowledge of oral cancer and precancer among dental outpatient in Klinik Pergigian Merlimau, Melaka'
At Apollo Hospital, Lucknow, U.P., we provide specialized care for children experiencing dehydration and other symptoms. We also offer NICU & PICU Ambulance Facility Services. Consult our expert today for the best pediatric emergency care.
For More Details:
Map: https://cutt.ly/BwCeflYo
Name: Apollo Hospital
Address: Singar Nagar, LDA Colony, Lucknow, Uttar Pradesh 226012
Phone: 08429021957
Opening Hours: 24X7
2. PYTHON
• A programming language developed
by Guido Van Rossum in feb-1991.
• Named after a comedy show namely
‘Monty Python’s Flying Circus’.
• It is based on ABC language.
• It is an open source language.
3. Features of Python
It is an pen source, so it can be
modified and redistributed.
Uses a few keywords and clear
,simply English like structure.
Can run on variety of platforms.
Support procedure oriented as well as
object oriented programming.
4. Features of Python
It support Graphical user interface.
It is compatible with C,C++ languages
etc.
Used in game development, data
base application, web application ,
Artificial Intelligence.
Lesser time required to learn Pyhton
as it has simple and concise code.
5. Features of Python
Distinguish between input, output and
error message by different colour
code.
Has large set of libraries with various
module functions.
Has automatic memory management.
Provide interface to all major
databases.
6. Applications of Python
• Amazon uses python to analyse customer’s
buying habits and search patterns.
• Facebook uses python to process images.
• Google uses python in search system.
• NASA uses python for scientific
programming tasks.
• Python is used in AI systems.
7. Python Character Set:
• A set of Valid characters that a language can recognize.
• A character set includes:
Letters : A-Z , a-z.
Digits : 0-9
Special Symbols :Space + -*/**(){}[]//!= ==<,>.’’ “”;:%!
White spaces : Blank space ,tabs carriage return ,new
line , form feed.
Other Characters : process all ASCII
8. Variable
• Has a name
• Capable of storing values of certain
data type.
• Provide temporary storage.
9. Variable naming conventions
• Variable names are case sensitive.
• Keywords or words with special meanings
should not be used as variables.
• Variable names should be short and
meaningful.
• All variable names should begin with a letter
or underscore(_).
• Variable names may contain numbers,
underscore,.
• no space or special character allowed
10. Keywords
• Keywords are the words that convey a
special meaning to the language
compiler/interpreter.
• These are reserved for special
purpose.
• Must not be used as normal variables.
• Eg: True, False , if, return , try, elif ,
and ,while, None ,with ,range ,break ,
for ,in ,or
11. Data Types
• Data types states the way the values of
that type are stored .
• The operations can be done on that
type and the range for that type.
• Different types of data requires different
amount of memory for storage.
• Data can be manipulated through
specific data types.
13. Number
• Number data type is used to store
numerical values.
• Python support three numerical data
types.
• Integer: eg a=2
• Float: eg: a=2.766
• Complex Numbers: a=17+9b
14. String
• An order of set of characters closed
in a single or double quotation marks.
• Eg: str1=‘Hello’
• wrd=“Hello”
15. List
• List is a collection of comma separated
values within square bracket.
• Values in the list can be modified.
• The values in the list are called
elements.
• It is mutable.
• Elements in the list need not be of
same type.
17. Tuple
• A tuple is a sequence of comma
separated values . Values in tuple
cannot be changed.
• It is immutable.
• The values in the tuple are called as
elements.
• Elements in the list need not be of
same type.
19. Dictionary
• An unordered collection of items where
each item is a key: value pair
• Each key is separated from its value
by a colon (:) .
• The entire dictionary is enclosed within
curly braces {}.
• Keys are unique within dictionary while
the values may not be.
21. Boolean data type
• The Boolean data type is either TRUE
or FALSE
• In python, Boolean variables are
defined by either True or False.
• The first letter of True and False must
be in upper case . Lower case returns
error
22. Eg:
>>> a=True
>>> type(a)
<class 'bool'>
>>> a=True
>>> b=False
>>> a or b
True
>>> a and b
False
>>> not a
False
>>> a==b
False
>>> a!=b
True
>>>
23. Data Type Conversion
• The process of converting the value of
one data type to another data type is
called type conversion.
• There are two types of conversion
• Implicit type conversion
• Explicit type conversion
24. Implicit type conversion
• In this python automatically convert
one data type to another.
• This process doesn’t need any user
involvement.
26. Explicit type conversion
• User convert the data type of an object
to the required data type.
• We use predefined functions like int(),
float(),complex(), bool(), str(), tuple(),
list() ,dict() etc to perform explicit type
conversion.
• This type conversion is also known as
type casting.
27. Input
a=100
b=20.50
c='567'
print('Variable a converted into string:',str(a))
print('Variable a converted into float:',float(a))
print('Variable b converted into integer:',int(b))
print('Variable b converted into string:',str(b))
print('Variable c converted into integer:',int(c))
print('Variable c converted into float:',float(c))
print('Variable a converted into list:',list(c))
OUTPUT
Variable a converted into string: 100
Variable a converted into float: 100.0
Variable b converted into integer: 20
Variable b converted into string: 20.5
Variable c converted into integer: 567
Variable c converted into float: 567.0
Variable a converted into list: ['5', '6', '7']
28.
29. Operators
• Are special symbols which represent
computation.
• Values or variables are called
oparands .
• The operator is applied on operands,
thus form expression.
38. User input
• The values inserted by the user while executing a program are
fetched and stored in the variable using the input() function.
39. User output
• The print statement is used to display
the value of a variable.
• If an expression is given with the print
statement ,it first evaluate the
expression and then print it.
• To print more than one item on a
single line comma (,) can be used.
41. comments
• A comment in Python starts with the hash
character, # , and extends to the end of the
physical line.
• Comments can be used to explain Python
code.
• Comments can be used to make the code
more readable.
• Comments can be used to prevent
execution when testing code.
42. Creating a Comment
• Comments starts with a #, and Python will ignore
them:
• Example
• #This is a comment
print("Hello, World!")
• Comments can be placed at the end of a line, and
Python will ignore the rest of the line:
• Example
• print("Hello, World!") #This is a comment
•
43. • A comment does not have to be text
that explains the code, it can also be
used to prevent Python from executing
code:
• Example
• #print("Hello, World!")
print("Cheers, Mate!")
44. Multi Line Comments
• Python does not really have a syntax
for multi line comments.
• To add a multiline comment you could
insert a # for each line:
• Example
• #This is a comment
#written in
#more than just one line
print("Hello, World!")
45. • Or, not quite as intended, you can use a
multiline string.
• Since Python will ignore string literals that are
not assigned to a variable, you can add a
multiline string (triple quotes) in your code, and
place your comment inside it:
• Example
• """
This is a comment
written in
more than just one line
"""
print("Hello, World!")
46. Indentation In Python
• Indentation refers to the spaces at the
beginning of a code line.
• Python uses indentation to indicate a block
of code.
• Python will give you an error if you skip the
indentation:
• You have to use the same number of
spaces in the same block of code, otherwise
Python will give you an error: