01-Introduction to programming with Python.pptx

ThilinaWanshathilaka1 0 views 18 slides Oct 11, 2025
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

Python Programming Basics


Slide Content

01-Introduction to programming with python By Thilina Wanshathilaka

What is a program Computer program is a set of instructions that tell how to interact with users, hardware and data . We wrote those instruction using programming languages There are two types of programming languages Low level programming languages High level programming languages

Low level Vs High level programming languages Low Level In first generation computers required that programmers to write explicit instructions to directly manipulate computer hardware. Lengthy Effective High level English like language Need intermediate steps to convert Minimal coding Slow

High level programming languages Compiling Programming language special piece of software (compiler) convert that in to intermediate file Then interpreter can execute that file . C,C++,Java, Pascal and any language used in .NET framework Interpreted programming language. D oesn't create intermediate file. Interpreter convert code in real-time to machine code when execute it. Python, Perl, Basic ,JavaScript.

Compiled VS Interpreted programming language

Algorithm noun:  algorithm ; plural noun:  algorithms a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer. Step by step guidance of achieve certain task or calculation. Must have clearly defined start ,end and finite amount of sequential steps. The transition from one step to the next is not necessarily deterministic.

Characteristic of good algorithm Unambiguous − Algorithm should be clear and unambiguous. Each of its steps (or phases), and their inputs/outputs should be clear and must lead to only one meaning. Input − An algorithm should have 0 or more well-defined inputs. Output − An algorithm should have 1 or more well-defined outputs, and should match the desired output. Finiteness − Algorithms must terminate after a finite number of steps. Feasibility − Should be feasible with the available resources. Independent − An algorithm should have step-by-step directions, which should be independent of any programming code.

Flowcharts One of the informal methods of presenting algorithm using graphical symbols. Very effective and simple.

Print Hello World 10 times Initialize count = 0    (PROCESS ) Print Hello World    (I/O ) Increment count by 1 (PROCESS ) Is count < 10 (DECISION ) If YES go to step 2 E lse Stop

Let’s do something really challenging Draw flow chart to get the following output 1-----99 2-----98 3-----97 . . . . . . 98-----2 99----- 1 Draw flow chart to print the factorial of a given number Draw flow chart to print the first 10 numbers Fibonacci series

History of Python Invented during the early 90s in the Netherlands by Guido van Rossum Guido van Rossum is fan of the Monty Pythons Flying Circus TV show and he name python programming language after that . It is open source from the beginning. It is considered as scripting language but it grow in to much bigger than that. Scalable, Object oriented and functional programming language since the start. Increasingly popular, expanding and diversifying day by day

Python’s Benevolent Dictator for Life Python is an experiment in how much freedom programmers need. Too much freedom and nobody can read another’s code and too little freedom and expressiveness is endangered --Guido van Rossum--

Use of Python Web Application and API development Scientific computing Data Science project including Data Visualization Computer Image processing Artificial intelligent and machine learning application development. Computer game development Embedded component for many 2D and 3D graphic and animation software

Use of Python Include in lot of operating system components Use extensively on information security industry as constructive and destructive tools Use Extensively in automation and robotics to develop embedded software and single board computer(Raspberry PI) software

Why Python These are the primary factors peoples are use python as development language Object Oriented Open source Indentation Powerful Portable Mixable Easy to use It is easy to learn

Code is understandable as plain English Let me prove it to you right now. Even if you have no experience in python or any programming language try to understand what this code will do.

Lets do something with python Print text Setup variables Get input from user Let’s play turtle game

That’s it for today Next week we will setup python environment if you have any laptop or tablet or even old smart phone please bring it with you we can setup python. Then you can practice at home . Please bring your internet connection with you. We need around 250MB to download essentials software