2. What is Programming?
● Computer: Device that inputs human instructions,
processes it and responds to the instructions.
● Programming is a way to “instruct the computer to perform
various tasks”.
3. What are algorithms?
● Set of steps to
accomplish a task
● Ex: algorithm for making
grill-cheese sandwich
6. Pseudocode - max of 2 given numbers
Step 1: Start
Step 2: Read a, b . /* a, b two numbers */
Step 3: If a>b then /*Checking */
Display “a is the largest number”.
Otherwise
Display “b is the largest number”.
Step 4: Stop.
7. Why programming languages??
● Communication link
between hardware and
software
● Set of instructions
through which humans
can communicate to
machines.
● Machines only
understand 0’s and 1’s
8. Programming errors
● Syntax Errors: Grammatical mistakes while writing the
code. Caught by compilers & interpreters.
● Logical Errors: Unexpected behavior. Difficult to find the
source of error as it’s not caught by compilers or
interpreters.
● Runtime Errors: IO Errors, Division by zero errors
9. Pydroid 3
● Installing the application - Download from app store
● Downloads python dependencies
● Can install other libraries manually
● Practice programs included
10. Python
● Python 2 is officially deprecated and replaced by Python 3.
● High-level
● Can work on different platforms (Mac, Linux, Windows,
Android)
● Open-source
11. Applications of Python
● Create web applications
● Software development
● Handle huge amounts of data & complex mathematics
● Has simple syntax similar to English
13. Hello World!
Running as .py file:
1. Open Pydroid 3
2. Write the output code
3. Click on Play button to run the code
4. Output will appear on the terminal
5. Click on the file option on the right side from the menu bar
6. Save As -> home -> create folder - Python workshop files
14. Variables
● Containers for storing data
● Created when a value is given to it
● No type information required with variables
● Variables can change type after they have been set
15. Variable name rules
● Short or more descriptive
● Cannot start with a number
● Only contain alphabets, numericals & underscore
● Case-sensitive names
18. Variables
● Loosely typed languages: don’t have to specify variable
data types
● Python is loosely typed language
You don’t have to tell that a string is a string or specify if
the input will be int.