- 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.
Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.
It is used for:
- web development (server-side),
- software development,
- mathematics,
- system scripting.
What can Python do?
Python can be used on a server to create web applications.
Python can be used alongside software to create workflows.
Python can connect to database systems. It can also read and modify files.
Python can be used to handle big data and perform complex mathematics.
Python can be used for rapid prototyping, or for production-ready software development.
- Why Python?
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-oriented way or a functional way.
- what we learn:
1- Python Install.
2- Python Comments.
3- Python Variables.
4- Python Data Types.
5- Python Numbers.
If you're referring to acquisitions made by companies prior to the implementation of the Goods and Services Tax (GST), here are some acquisitions that occurred before GST was introduced:
Facebook (Meta Platforms, Inc.):
Instagram (Acquired in 2012)
WhatsApp (Acquired in 2014)
Oculus VR (Acquired in 2014)
Alphabet Inc. (Google):
YouTube (Acquired in 2006)
DoubleClick (Acquired in 2008)
Nest Labs (Acquired in 2014)
Amazon:
Zappos (Acquired in 2009)
Twitch (Acquired in 2014)
Microsoft Corporation:
LinkedIn (Acquired in 2016)
Skype (Acquired in 2011)
Apple Inc.:
Beats Electronics (Acquired in 2014)
Shazam (Acquisition announced in 2017, completed in 2018)
Oracle Corporation:
Sun Microsystems (Acquired in 2010)
Siebel Systems (Acquired in 2006)
IBM (International Business Machines Corporation):
Cognos (Acquired in 2007)
SPSS (Acquired in 2009)
Salesforce:
Tableau Software (Acquired in 2019)
MuleSoft (Acquired in 2018)
Cisco Systems:
WebEx (Acquired in 2007)
Meraki (Acquired in 2012)
Intel Corporation:
McAfee (Acquired in 2011)
Altera Corporation (Acquired in 2015)
These are just a few examples of acquisitions made by companies prior to the implementation of GST. These acquisitions have played significant roles in shaping the strategies and offerings of these tech giants.
If you're referring to acquisitions made by companies prior to the implementation of the Goods and Services Tax (GST), here are some acquisitions that occurred before GST was introduced:
Facebook (Meta Platforms, Inc.):
Instagram (Acquired in 2012)
WhatsApp (Acquired in 2014)
Oculus VR (Acquired in 2014)
Alphabet Inc. (Google):
YouTube (Acquired in 2006)
DoubleClick (Acquired in 2008)
Nest Labs (Acquired in 2014)
Amazon:
Zappos (Acquired in 2009)
Twitch (Acquired in 2014)
Microsoft Corporation:
LinkedIn (Acquired in 2016)
Skype (Acquired in 2011)
Apple Inc.:
Beats Electronics (Acquired in 2014)
Shazam (Acquisition announced in 2017, completed in 2018)
Oracle Corporation:
Sun Microsystems (Acquired in 2010)
Siebel Systems (Acquired in 2006)
IBM (International Business Machines Corporation):
Cognos (Acquired in 2007)
SPSS (Acquired in 2009)
Salesforce:
Tableau Software (Acquired in 2019)
MuleSoft (Acquired in 2018)
Cisco Systems:
WebEx (Acquired in 2007)
Meraki (Acquired in 2012)
Intel Corporation:
McAfee (Acquired in 2011)
Altera Corporation (Acquired in 2015)
These are just a few examples of acquisitions made by companies prior to the implementation of GST. These acquisitions have played significant roles in shaping the strategies and offerings of these tech giants.
If you're referring to acquisitions made by companies prior to the implementation of the Goods and Services Tax (GST), here are some acquisitions that occurred before GST was introduced:
Facebook (Meta Platforms, Inc.):
Instagram (Acquired in 2012)
WhatsApp (Acquired in 2014)
Oculus VR (Acquired in 2014)
Alphabet Inc. (Google):
YouTube (Acquired in 2006)
DoubleClick (Acquired in 2008)
Nest Labs (Acquired in 2014
Here are the answers to the exercises:
1. The len() method is used to find the length of a string.
2. To get the first character of the string txt, it would be:
txt="hello"
x=txt[0]
3. The strip() method removes any whitespace from the beginning or the end of a string.
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.
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.
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, high-level programming language that is widely used for web and application development, data science, and machine learning. It was created by Guido van Rossum in 1991 and takes inspiration from languages like C, Java, Lisp, and Modula-3. Python code is human-readable and has an easy to learn syntax that uses indentation rather than brackets to indicate blocks of code. It supports multiple programming paradigms including object-oriented, imperative, and functional programming.
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.
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.
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.
Python Course In Ghaziabad. Scode network is best training institute for Python which provides Online Python course with complete certificates at an affordable price.
The document provides an overview of the Python programming language. It discusses what Python is, its history and naming, features like being dynamically typed and interpreted, popular applications like web development, machine learning, and its architecture. It also covers Python constructs like variables, data types, operators, and strings. The document compares Python to other languages and provides examples of common Python concepts.
Interpreter v/s Compiler summarizes the key differences between interpreters and compilers. Interpreters translate programs one statement at a time with no object code generated, making them more memory efficient. Compilers scan entire programs and translate them into machine code at once, generating object code and requiring more memory but providing faster overall execution time. Popular languages like JavaScript, Python, and Ruby use interpreters while C, C++, and Java use compilers.
The document compares interpreters and compilers. It states that interpreters translate code line-by-line while compilers scan the entire program at once. Interpreters have faster analysis time but slower overall execution, while compilers have slower analysis but faster execution. Interpreters do not generate object code so are more memory efficient. Languages like JavaScript, Python and Ruby use interpreters, while C, C++ and Java use compilers.
The document provides an introduction to Python programming, including details about Python's history, versions, data types, strings, and code execution. It discusses how to install Python and write basic programs. Key reasons for using Python are its object-oriented nature, readability, large standard library, cross-platform capabilities, and ease of use. The document also covers string methods and slicing, numeric data types, installing Python, and running code in interactive and script modes.
This document provides an introduction to Python programming. It discusses the history and origins of Python, its key features and applications. Some of the main points covered include:
- Python was created in the late 1980s by Guido van Rossum and takes influence from other languages like ABC, Modula-3, C, C++ and Unix shell scripts.
- Python is an interpreted, object-oriented scripting language that is designed to be highly readable. It has applications in systems programming, GUIs, web development, data analysis, scientific computing and more.
- The document outlines Python's technical strengths like being free, portable, powerful, easy to use and learn. It also covers basics like variables,
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.
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, high-level programming language that is widely used for web and application development, data science, and machine learning. It was created by Guido van Rossum in 1991 and takes inspiration from languages like C, Java, Lisp, and Modula-3. Python code is human-readable and has an easy to learn syntax that uses indentation rather than brackets to indicate blocks of code. It supports multiple programming paradigms including object-oriented, imperative, and functional programming.
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.
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.
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.
Python Course In Ghaziabad. Scode network is best training institute for Python which provides Online Python course with complete certificates at an affordable price.
The document provides an overview of the Python programming language. It discusses what Python is, its history and naming, features like being dynamically typed and interpreted, popular applications like web development, machine learning, and its architecture. It also covers Python constructs like variables, data types, operators, and strings. The document compares Python to other languages and provides examples of common Python concepts.
Interpreter v/s Compiler summarizes the key differences between interpreters and compilers. Interpreters translate programs one statement at a time with no object code generated, making them more memory efficient. Compilers scan entire programs and translate them into machine code at once, generating object code and requiring more memory but providing faster overall execution time. Popular languages like JavaScript, Python, and Ruby use interpreters while C, C++, and Java use compilers.
The document compares interpreters and compilers. It states that interpreters translate code line-by-line while compilers scan the entire program at once. Interpreters have faster analysis time but slower overall execution, while compilers have slower analysis but faster execution. Interpreters do not generate object code so are more memory efficient. Languages like JavaScript, Python and Ruby use interpreters, while C, C++ and Java use compilers.
The document provides an introduction to Python programming, including details about Python's history, versions, data types, strings, and code execution. It discusses how to install Python and write basic programs. Key reasons for using Python are its object-oriented nature, readability, large standard library, cross-platform capabilities, and ease of use. The document also covers string methods and slicing, numeric data types, installing Python, and running code in interactive and script modes.
This document provides an introduction to Python programming. It discusses the history and origins of Python, its key features and applications. Some of the main points covered include:
- Python was created in the late 1980s by Guido van Rossum and takes influence from other languages like ABC, Modula-3, C, C++ and Unix shell scripts.
- Python is an interpreted, object-oriented scripting language that is designed to be highly readable. It has applications in systems programming, GUIs, web development, data analysis, scientific computing and more.
- The document outlines Python's technical strengths like being free, portable, powerful, easy to use and learn. It also covers basics like variables,
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays
Boost API Development Velocity with Practical AI Tooling
Sumit Amar, VP of Engineering at WEX
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
Report based on the findings of a quantitative research conducted by the research agency New Image Marketing Group, commissioned by the NGO Detector Media, compiled by PhD in Sociology Marta Naumova.
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays
CIAM in the wild: What we learned while scaling from 1.5 to 3 million users
Michael Gruen, VP of Engineering at Layr
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
Convene 360 Madison, New York
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays
Spring Modulith Design for Microservices
Renjith Ramachandran, Senior Solutions Architect at BJS Wholesale Club
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
Convene 360 Madison, New York
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
Report based on the findings of a quantitative research conducted by the research agency New Image Marketing Group, commissioned by the NGO Detector Media, compiled by PhD in Sociology Marta Naumova.
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...apidays
What exactly are AI Agents?
Aki Ranin, Head of AI at Earthshots Collective | Deep Tech & AI Investor | 2x Founder | Published Author
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...apidays
Enhancing Developer Productivity with UX
Petrine Tang, UX Designer at Government Technology Agency
Faith Ang, Product Manager at Government Technology Agency
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays
You Can't Outrun Complexity - But You Can Orchestrate It: Lessons From Two Technical Transformations
Leah Hurwich Adler, Senior Staff Product Manager at Apollo GraphQL
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays
Computers are still dumb: bringing your AI magic to enterprises
Ben Morss, Developer Evangelist at DeepL
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
Convene 360 Madison, New York
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays
Beyond Webhooks: The Future of Scalable API Event Delivery
Phil Leggetter, Head of Developer Experience at Hookdeck
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
At Opsio, we specialize in delivering advanced cloud services that enable businesses to scale, transform, and modernize with confidence. Our core offerings focus on cloud management, digital transformation, and cloud modernization — all designed to help organizations unlock the full potential of their technology infrastructure.We take a client-first approach, blending industry-leading hosted technologies with strategic expertise to create tailored, future-ready solutions. Leveraging AI, automation, and emerging technologies, our services simplify IT operations, enhance agility, and accelerate business outcomes. Whether you're migrating to the cloud or optimizing existing cloud environments, Opsio is your partner in achieving sustainable, measurable success.
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays
The Future of Small Business Lending with Open Banking – Bridging the $750 Billion Funding Gap
Charles Groome, Vice President of Growth Strategy at Biz2Credit
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays
4 identity factors you didn't know you needed to support large organizations in your SaaS
Daizen Ikehara, Principal Developer Advocate at Auth0
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
3. PROGRAMMING
LANGUAGE
•A programming language is a type of
written language that tells computers
what to do.
•A "program" in general, is a sequence
of instructions written so that a
computer can perform certain task.
5. Types of programming languages
The programming languages are broadly classified into three types,
• Low-level language
• High-level language
• Middle-level language
6. Low-level langu
age
It is machine-dependent.
It works based on the binary number
0’s and 1’s.
The processor runs low-level programs
directly without the need of a compiler
or interpreter so the program written in
low-level language can be run very fast.
7. High-level programming language
High-level programming language (HLL) is designed for developing
user-friendly software programs and websites.
This programming language requires a compiler or interpreter to
translate the program into machine language (execute the program).
Example: Python, Java, JavaScript, PHP, C#, C++, etc.
8. Middle-level programming language
Middle-level programming language lies between the low-level programming language and the
high-level programming language.
It is also known as the intermediate programming language and pseudo-language.
A middle-level programming language's advantages are that it supports the features of
high-level programming, it is a user-friendly language, and is closely related to machine
language and human language.
Example: C, C++, language
10. PROGRAMMING
VS
SCRIPTING
Scripts are few lines of code used
within a program. These scripts
are written to automate some
particular tasks within the
program.
Programming languages are a set
of code/instructions for the
computer that are compiled at
runtime. Thus an exe file is
created
12. HISTORY
Python was created by Guido van Rossum,
and first released on February 20, 1991.
While you may know the python as a large
snake, the name of the Python
programming language comes from an old
BBC television comedy sketch series called
Monty Python's Flying Circus.
15. FEATURES
Easy to read and learn
Free and Open source
Cross platform
Large standard library
Extensible
GUI Programming support
16. APPLICATIONS
Web applications
GUI based desktop
applications(Games,
Scientific
Applications)
Operating Systems
Enterprise and
Business
applications
Audio or video
based applications
3D CAD application
19. Ways to run Python Scripts
1. Command Line [python script.py]
✔ Open a terminal or command prompt.
✔ Navigate to the directory containing your Python script using the cd command.
2. IDLE (Python's Integrated Development and Learning Environment):
✔ Open IDLE and use the "File" menu to open your script, then run it.
3. Jupyter Notebooks [Using interpreter interactively]
✔ If you are using Jupyter Notebooks, you can run individual cells or the entire notebook.
✔ Use the "Run" button or press Shift + Enter to execute a cell.
20. IDE
An integrated development
environment (IDE) is a
software application that
helps programmers develop
software code efficiently. It
increases developer
productivity by combining
capabilities such as software
editing, building, testing, and
packaging in an easy-to-use
application.
21. ANACONDA PYTHON
Anaconda is a distribution of the Python
and R programming languages for
scientific computing (data science,
machine learning applications,
large-scale data processing, predictive
analytics, etc.), that aims to simplify
package management and
deployment.
24. VARIABLE
• In Python, variables are a storage placeholder for texts and numbers.
• It must have a name so that you are able to find it again
• The variable is always assigned with the equal sign, followed by the value of the variable.
• A variable is created the moment we first assign a value to it.
Example:
a=10
b=“IBM”
print(a)
Print(b)
25. RULES FOR CREATING VARIABLES
Must start with a letter or the underscore character
Cannot start with a number
Can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Case-sensitive (name, Name and NAME are three different variables)
The reserved words(keywords) cannot be used naming the variable
28. Can we use
same name
for different
types?
If we use same name, the variable
starts referring to new value and type.
Example:
x=23
x=“salary”
print(x)
29. How does +
operator work
with variables
Example:
x = 100
y = 200
print(x + y)
x = "IBM"
y = "CE"
print(x + y)
30. Can we use + for different
types also?
‘+’ used for adding different data types will produce an error.
Example:
age= 10
name = "David"
print(age+name)
OUTPUT: TypeError: unsupported operand type(s) for +: 'int'
and 'str'
31. Keywords
•Keywords are special reserved words
which convey a special meaning to the
compiler/interpreter.
•Each keyword have a special meaning
and a specific operation.
import keyword
print(keyword.kwlist)
33. IO OPERATIONS
•print( ) - Used for output operation
•input( ) - Used for input operations.
name = input()
number = int(input())
print ('my name is:’, name, 'and my age is:',
number)
35. DATA TYPES
Immutable Data Types
Numeric types(int, float, complex)
Tuple
String and Boolean
Mutable Data Types
List
Dictionary
Set
36. Data Types:-
Variables will hold values, and every value has its own
data-type.
Python is a dynamically typed language
Hence we do not need to define the type of the variable
while declaring it.
The interpreter implicitly binds the value with its type.
37. a = 5
The variable a holds integer value five and we did not define
its type. Python interpreter will automatically interpret
variables a as an integer type.
Python enables us to check the type of the variable used in the
program. Python provides us the type() function, which
returns the type of the variable passed.
38. Numeric Datatype :-
Numeric values are known as numbers.
There are three types.
integer, float, and complex
(They may be +ve /-ve)
Python provides the type() function to know the data-type
of the variable.
40. Comments
Helps explaining Python code.
make the code more readable.
prevent execution when testing code.
Comments starts with a #, and Python will ignore them
41. Constants
A constant is a special type of variable whose value cannot
be changed.
import constant
print(constant.PI) # prints 3.14
print(constant.GRAVITY) # prints 9.8
42. Type Conversion:-
#convert from int to float:
x = 1
a = float(x)
print(a)
#convert from float to int:
y = 2.8
b = int(y)
print(b)
#convert from int to complex:
z = 1
c = complex(z)
print(c)
43. Points to Remember:-
All the keywords must be used as they have defined.
(Uppercase and Lower Case)
Keywords should not be used as identifiers like variable names,
functions name, class name, etc.
The meaning of each keyword is fixed, we can not modify or
remove it.
45. Strings
String is a sequence of characters.
String may contain alphabets, numbers and special characters.
Usually strings are enclosed within a single quotes and double
quotes.
Example: a= “hello world‟ b= ‘Python’
We can display a string literal with the
print() function.
46. Example 1:
String1 ="I'm a technical lead"
print(String1)
Example 2 :
String2 ='I'm a technical lead’
print(String2)
Example 3:
String3 ='''I'm a technical lead and “tester”"'
print(String3)
Example 4:
String4 =‘‘‘python
for
datascience ”’
print(String4)
47. OUTPUT for Example 1:
I'm a technical lead
OUTPUT for Example 2:
SyntaxError: invalid syntax
OUTPUT for Example 3:
I'm a technical lead and "tester"
OUTPUT for Example 4:
python
for
datascience
48. Multiline Strings
We can assign a multiline string to a variable by using three quotes.
a = ""“You get
What you work for
Not what you
wish for."""
print(a)
49. Strings in Python are arrays of bytes representing unicode characters.
Python does not have a character data type, a single character is simply a
string with a length of 1.
Square brackets can be used to access elements of the string.
Indexing:-
a = "Hello, World!"
print(a[1])
50. Accessing characters in Python
Individual characters of a String can be accessed by using
the method of Indexing.
To access a range of characters in the String, method of
slicing is used.( done by using a Slicing operator (colon)).
51. Strings indexing and splitting
The indexing of the python strings starts from 0.
52. b = "Hello, World!"
print(b[3:-5])
Slicing:-
b = "Hello,World!"
print(b[2:5])
b = "Hello,World!"
print(b[:5])
b = "Hello,World!"
print(b[2:])
54. Deleting/Updating from a String
Updation or deletion of characters from a String is not allowed.
This will cause an error because item assignment or item
deletion from a String is not supported.
Although deletion of entire String is possible with the use of a
built-in del keyword.
This is because Strings are immutable, hence elements of a
String cannot be changed once it has been assigned.
Only new strings can be reassigned to the same name.
55. Deleting Entire String:(using del keyword)
Example:
String1 = "Hello, I'm john"
print(String1)
# Deleting entire String
del String1
print("nDeleting the entire string ")
print(String1)
58. NOTE
✔ While accessing an index out of the range will cause an Index
Error.
✔ Only Integers are allowed to be passed as an index, float or
other types will cause a TypeError.
59. String operations
Concatenation of Two or More Strings
Removes any whitespace from the beginning or the end
The length of a string
Strings in lower case
Strings in upper case
Replaces a string with another string
Splits the string into substrings
60. Concatenation of Two or More Strings
Joining of two or more strings into a single one is called
concatenation.
Example:
str1 = "python"
str2 ="programming"
# using +
print("str1 + str2 = ", str1 + str2)
OUTPUT:
str1 + str2 = pythonprogramming
62. Removes any whitespace from the beginning or the
end
Example:
A = “ Hello, World! ”
print(A)
a = " Hello, World! “
print(a.strip())
OUTPUT:
Hello, World!
Hello, World!
63. To find the the length of a string
Example:
a = "Hello, World!"
print(len(a))
OUTPUT:
13
64. Strings in lower case
Example:
a = "HELLO, World!"
print(a.lower())
OUTPUT:
hello, world!
65. Strings in upper case
Example:
a = "Hello, World!"
print(a.upper())
OUTPUT:
HELLO, WORLD!
66. Replaces a string with another string
Example:
a = "Hello, World!"
print(a.replace("H", “F"))
OUTPUT:
Fello, World!
67. Splits the string into substrings
Example:
a = "Hello, World!"
print(a.split(","))
OUTPUT:
['Hello', ' World!']