Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Python Basics

Uploaded by

back94013
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python Basics

Uploaded by

back94013
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Python Basics

Introduction to Programming
Complete Python Curriculum
Become a Well-Rounded Pythonista
How do you learn Python?
• Self-Study
• Reading a Book
• Watching YouTube Videos
• Reading Official Documentation
• Participating in a community forums
• Subscribing to newsletters
• Reading feeds
• Following X accounts
• Following Facebook accounts
• Using Slack chats

• Training Course
• Academic Course
• Beer Group
Online Resources
• https://pycoders.com/
• peruse the articles & tutorials featured
• http://wiki.python.org/moin/UsefulModules
• pick a popular module that interests you and create your own project
around it
• http://projecteuler.net/problems
• try working through some of the mathematical challenges
• https://github.com/languages/Python
• consider helping out with an open-source project on GitHub
• http://stackoverflow.com/questions/tagged/python
• Search around for answers
• https://www.pythonistacafe.com/
• find a community of Pythonistas willing to help you out
Online Resources
• https://pymotw.com/3
• ‘Python 3 module of the Week’ . This lists many of the
libraries/modules available and provides a short introduction to what
they do and how to use them.
Offline Resources
What Do you need to have
• A computer. It could be a Windows PC, a Linux box or an Apple
Mac
• At a minimum, you will need Python 3
• You need to setup a development environment
Text Editor, Code Editor and IDE
IDEs available for Python include
• Rodeo which is a lightweight, open source, IDE see
https://rodeo.yhat.com.
• Jupyter Notebook which is a web-based IDE and is particularly
good for data scientists https://jupyter.org.
• Visual Studio Code. This is a very good free editor from Microsoft
that has really useful features https://code.visualstudio.com.
• Sublime Text is more of a text editor that color codes Python;
however, for a simple project it may be all you need
https://www.sublimetext.com.
• PyCharm
Code Editors
• Emacs, Vim, Notepad++, Sublime Text, Visual Studio Code
Integtarted Development Environments
(IDEs)
• PyCharm and Eclipse
What is Python?
• In our context, Python is not the snake
• It is a computer programming language
• What is
• Computer?
• Programming?
• Language?
• Python is a general-purpose programming language
• originally conceived back in the 1980s by Guido van Rossum at
Centrum Wiskunde & Informatica (CWI) in the Netherlands
• The language is named after one of Guido’s favourite programs
“Monty Pythons Flying Circus”. a classic British comedy sketch show.
What is Programming?
Data and Information
• Data is raw facts in form that can be managed and processed
by computer. It can be text, numbers, picture, sound, video
• Data normally are in binary (or digital) form
• Data can represent any object from real life
• Data can be the temperature captured by a sensor
• Data can be the design measurements of a car engine
• Data can be motion captured by a web cam
Computer Components
Why Python? Why learn it not others?
• There is currently huge interest in the Python programming
language
• It is the world’s most popular and welcoming programming
language. Why? What are driven factors? Well, there are several
driven factors
• First factor is its wide usage applications
• its use in schools with the Raspberry Pi platform,
• its ability to be used for DevOps scripts,
• its use in data science and machine learning,
• and of course, the language itself
• The beginner-friendly programming language (How?)
Python Ecosystem
• The CPython Team: producing the amazing programming
language and tools that we love and work with every day.
• The Python Community: The people who are working hard to
make Python the most beginner-friendly and welcoming
programming language in the world, running conferences, and
maintaining critical infrastructure like PyPI as well all Python
developers
IDLE
• IDLE stands for Integrated Development and Learning
Environment
• It is Python’s built-in Integrated Development Environment
• It is a way to create, edit, and save and run Python code files
Variable
• A variable is a name that refers (or references) an actual data
value that is stored (or held) in an area of the main memory.
• The variable allows us to access the data value that is sored in
an area of memory easily and conveniently.
• It is a called a variable because the variable name can be
assigned and hence refer to other data value in memory. So
the data value that is referenced by the variable name can
vary during the lifetime of the program.
Number Data Types
• There are three data types for numbers. These are
• Integer number
• Float-Point number
• Complex number
Integer Numbers
• An integer is a whole number with no decimal point
• It could be positive, Zero, or negative
• Example of integers are:
• 735
• 25
• 0
• -432
• 1000000
• For very large positive integer or very small negative integer, group of
digits can be separated by underscore( _ )
• For example, instead of typing 1000000 you can type 1000_000
• Usually three digits are grouped togather, but this is not a must. For
example, it is possible to type the following integer 1_32_872_1 which is
1328721
Float Numbers
Complex Numbers
Operators
• What is an operator?
• An operator is usually a symbol that denote an operation on
data values
• Some operators may have more than symbol (such as **)
Mathematical Operators
•+
•-
•*
•/
• //
•%
String Operators
• There are two string operators
•+
•*
• When the + operator is used on strings values, it is referred to
as concatenation operator.
Expression
• Mutable
• Immutable
• Iterable: A data type that its single value contain multiple
values that can be accessed one-by-one. Examples of iterable
data types are strings, tuples, lists, ranges. Integers and floats
are non-iterable data types. You can loop over iterable data
types in for loop
• Sequence
Python’s Third-Party Packages
• Python standard library comes with many packages
• Python’s ecosystem of third-party packages are one of its
greatest
• strengths.
• These packages allow Python programmers to be highly
productive and create full-featured software much more
quickly than can be done in, say, a language like C++.
• The beauty of third-party packages is that they give you the
ability to add functionality to your project without having to
implement every thing from scratch. This offers massive
boosts in productivity.

You might also like