0% found this document useful (0 votes)
14 views23 pages

Python Programming: Overview & Features

Uploaded by

mususenijr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views23 pages

Python Programming: Overview & Features

Uploaded by

mususenijr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Learning Outcomes of the Week: WEEK 1

Computer Programming 1
in Python
At the end of this week, : you should be able to know the:

1.1 Introduction to The Python Programming Language


1.2 History
1.3 Areas of Application
1.4 Features

Prepared by: Sinkala

2/12/2025 © 2022. Cavendish University. Rights Reserved 0


Learning Outcomes of the Week: WEEK 1

History of Python

Python was developed by Guido van Rossum in the late eighties and
early nineties at the National Research Institute for
Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC,
Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and
other scripting languages

2/12/2025 © 2022. Cavendish University. Rights Reserved 1


Learning Outcomes of the Week: WEEK 1

Overview of Python

Today, Python is one of the most popular programming


languages. Python is consistently rated as one of the
world's most popular programming languages. Python
is fairly easy to learn, so if you are starting to learn any
programming language then Python could be your
great choice. Although it is a general-purpose
language, it is used in various areas of applications
such as Machine Learning, Artificial Intelligence, web
development, IoT, and more.

2/12/2025 © 2022. Cavendish University. Rights Reserved 2


Learning Outcomes of the Week: WEEK 1

What is Python?

Python is a very popular general-purpose


interpreted, interactive, object-oriented, dynamic
and high-level programming language.
It was created by Guido van Rossum during 1985-
1990. Like Perl, Python source code is also available
under the GNU General Public License (GPL).

Python supports multiple programming paradigms, including


Procedural, Object Oriented and Functional programming
language.

2/12/2025 © 2022. Cavendish University. Rights Reserved 3


Learning Outcomes of the Week: WEEK 1

Areas of application?

Python is very high in demand and all the major


companies using it include:
• Google
• Intel • Python for Data Science
• NASA •Python for Machine Learning
• PayPal •Python for Web Development
• Facebook •Python for Computer Vision
• IBM and Image processing
• Amazon •Python for Embedded Systems
• Netflix and IoT
• Uber •Python for Job Scheduling and
Automation

2/12/2025 © 2022. Cavendish University. Rights Reserved 4


Learning Outcomes of the Week: WEEK 1

Careers with Python

Some of the career options where Python is a key skill.- include:


• Game developer
• Web designer
• Python developer
• Full-stack developer
• Machine learning engineer
• Data scientist
• Data analyst
• Data engineer
• DevOps engineer
• Software engineer
• Many more other roles
2/12/2025 © 2022. Cavendish University. Rights Reserved 5
Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Some of the career options where Python is a key skill.-


include:
• It supports functional and structured programming methods
as well as OOP.
• It can be used as a scripting language or can be compiled to
byte-code for building large applications.
• It provides very high-level dynamic data types and supports
dynamic type checking.
• It supports automatic garbage collection.
• It can be easily integrated with C, C++, COM, ActiveX,
CORBA, and Java

2/12/2025 © 2022. Cavendish University. Rights Reserved 6


Learning Outcomes of the Week: WEEK 1

Features of Python

• Easy-to-learn/code − Python has few keywords, simple structure,


and a clearly defined syntax.
• Open Source and Free:
Python is an open-source programming language which means that
anyone can create and contribute to its development.
• A broad standard library − Python's bulk of the library is very
portable and cross-platform compatible on UNIX, Windows, and
Macintosh.
• Interactive Mode − Python has support for an interactive mode which
allows interactive testing and debugging of snippets of code.
• Highly Portable − Python can run on a wide variety of hardware
platforms and has the same interface on all platforms.

2/12/2025 © 2022. Cavendish University. Rights Reserved 7


Learning Outcomes of the Week: WEEK 1

Features of Python

• Extendable − You can add low-level modules to the Python


interpreter. These modules enable programmers to add to or
customize their tools to be more efficient.
• Databases − Python provides interfaces to all major commercial
databases.
• GUI Programming − Python supports GUI applications that can
be created and ported to many system calls, libraries and
windows systems, such as Windows Foundation Classes(MFC),
Macintosh, and systems of Unix.
• Scalable − Python provides a better structure and support for
large programs than shell scripting.

2/12/2025 © 2022. Cavendish University. Rights Reserved 8


Learning Outcomes of the Week: WEEK 1

Features of Python

Open Source and Free:


Python is an open-source programming language which means that
anyone can create and contribute to its development.
Support for GUI:
Python has support for a wide array of GUIs which can easily be
imported to the interpreter, thus making this one of the most
favorite languages for developers.

2/12/2025 © 2022. Cavendish University. Rights Reserved 9


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Character set:
character set is a valid set of characters recognized by the Python language.
These are the characters we can use during writing a script in Python.
Python supports all ASCII / Unicode characters that include:
• Alphabets: All capital (A-Z) and small (a-z) alphabets.
• Digits: All digits 0-9.
• Special Symbols: Python supports all kind of special symbols like, ” ‘ l
;:!~@#$%^`&*()_+–={}[]\.
• White Spaces: White spaces like tab space, blank space, newline,
and carriage return.
• Other: All ASCII and UNICODE characters are supported by Python
that constitutes the Python character set.
2/12/2025 © 2022. Cavendish University. Rights Reserved 10
Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
A token is the smallest individual unit in a python
program. All statements and instructions in a
program are built with tokens. The various
tokens in python are
1. Keywords:
2. Identifiers:
3. Literals or Values:
4. Operators:
5. Punctuators:

2/12/2025 © 2022. Cavendish University. Rights Reserved 11


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
1. Keywords:
Keywords are words that have some special
meaning or significance in a programming language.
They can’t be used as variable names, function
names, or any other random purpose. They are used
for their special features. In Python we have 33
keywords some of them are: try, False, True, class,
break, continue, and, as, assert, while, for, in, raise,
except, or, not, if, elif, print, import, etc

2/12/2025 © 2022. Cavendish University. Rights Reserved 12


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
2. Identifiers:
Identifiers are the names given to any variable, function,
class, list, methods, etc. for their identification.
Python is a case-sensitive language and it has some rules
and regulations to name an identifier.
Python is case-sensitive. So case matters in naming
identifiers. And hence cuz and Cuz are two different
identifiers. RULES NAMING Identifiers
Identifier starts with a capital letter (A-Z) , a small letter (a-
z) or an underscore( _ ). It can’t start with any other character.
Except for letters and underscore, digits can also be a part of
identifier but can’t be the first character of it.
• Any other special characters or whitespaces are strictly
prohibited in an [Link] identifier can’t be a keyword
2/12/2025 © 2022. Cavendish University. Rights Reserved 13
Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
3. Literals or Values:
Literals are the fixed values or data items used in a
source code.
(i) String Literals: The text written in single,
double, or triple quotes represents the string
literals in Python
(ii) (ii) Character Literals: Character literal is also a
string literal type in which the character is
enclosed in single or double-quotes.

2/12/2025 © 2022. Cavendish University. Rights Reserved 14


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
3. Literals or Values:
(iii) Numeric Literals: These are the literals written in form
of numbers. Python supports the following numerical
literals:
• Integer Literal: It includes both positive and negative
numbers along with 0. It doesn’t include fractional
parts. It can also include binary, decimal, octal,
hexadecimal literal.
• Float Literal: It includes both positive and negative
real numbers. It also includes fractional parts.
• Complex Literal: It includes a+bi numeral, here a
represents the real part and b represents the complex
2/12/2025 © 2022. Cavendish University. Rights Reserved 15
Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
3. Literals or Values:
(iv) Boolean Literals: Boolean literals have only
two values in Python. These are True and False
(v) Special Literals: Python has a special literal
‘None’. It is used to denote nothing, no values, or the
absence of value.

2/12/2025 © 2022. Cavendish University. Rights Reserved 16


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
4. Operators:
These are the tokens responsible to perform an
operation in an expression.

Operators refer to special symbols that perform operations


on values and variables.
Main categories include:
I. Arithmetic Operators
II. Relational Operators
[Link] Operators

2/12/2025 © 2022. Cavendish University. Rights Reserved 17


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Arithmetic Operators

used to perform mathematical operations like

a) Addition, Subtraction, Multiplication, Division,


Modulus, Exponentiation, Floor division

In Python, ** is the exponentiation operator

2/12/2025 © 2022. Cavendish University. Rights Reserved 18


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

I. Relational Operators
Used for comparing two or more values.
It either returns True or False in accordance with the
condition. (also called comparison operators.)

>
<
>=
<=
== etc

2/12/2025 © 2022. Cavendish University. Rights Reserved 19


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

I. Logical Operators

Python logical operators are used to combine


conditional statements, allowing you to perform
operations based on multiple conditions.
i. AND
ii. OR
iii. NOT

2/12/2025 © 2022. Cavendish University. Rights Reserved 20


Learning Outcomes of the Week: WEEK 1

Characteristics of Python

Tokens:
[Link]:
These are the symbols that are used in Python to
organize the structures, statements, and expressions.
Some of the Punctuators are:

[ ] { } ( ) @ -= += *= //= **== = , etc

2/12/2025 © 2022. Cavendish University. Rights Reserved 21


Tools to use:

Download: Python according to your specifications from


[Link]
Download VS CODE
[Link]

Thank you

You might also like