From 8a2babb261b419e3dc2002cb40ce14803c7bb6e3 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sat, 24 Dec 2022 04:50:37 +0530 Subject: [PATCH] Initial commit --- index.css | 6 ++ index.html | 29 ++++++++ slides.md | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 247 insertions(+) create mode 100644 index.css create mode 100644 index.html create mode 100644 slides.md diff --git a/index.css b/index.css new file mode 100644 index 0000000..eeffaaa --- /dev/null +++ b/index.css @@ -0,0 +1,6 @@ +table, th, td { + border: 1px solid; + border-collapse: collapse; + padding: 6px 15px; + margin: auto; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..50ec700 --- /dev/null +++ b/index.html @@ -0,0 +1,29 @@ + + + + Title + + + + + + + + + diff --git a/slides.md b/slides.md new file mode 100644 index 0000000..125e280 --- /dev/null +++ b/slides.md @@ -0,0 +1,212 @@ +class: center, middle + +# Introduction to Programming +## Irene - Dec 24, 2022 + +--- + +# Basics of Computers + +Computers are made of three basic parts + +1. Processing +2. Input/Output +3. Storage + + +??? +Start by talking about how a computer has three parts. Draw an analogy to the human body. + +Draw this diagram on board to explain the interaction + +``` +----------- ---------------- ------------- +| Input | <--> | Processing | <---> | Storage | +----------- ---------------- ------------- + ^ + | + v + ------------ + | Output | + ------------ +``` +-- +- Processing is done by the CPU. +- Input/Output devices are for instance: keyboard, mouse. + +--- +# How do Computers Speak? + +Computers use a different language than humans. Just like humans communicate in +natural languages like Hindi, Kashmiri, English, etc, computers communicate in +binary. + +- English: `marker` +- Binary: ` 01101101 01100001 01110010 01101011 01100101 01110010` + +-- + +## ASCII Codes + +| Letter | Decimal | Binary | +|:------:|:-------:|----------| +| A | 65 | 01000001 | +| a | 97 | 01100001 | +| B | 66 | 01000010 | +| b | 98 | 01100010 | +| . | 46 | 00101110 | + +--- + +# How does code run? + +- Computers read a piece of code from memory. +- Each number is a special instruction. +- The number tells the computer what to do. +- The computer executes this and then moves on to the next instruction. + + +??? + +Build a hypothetical machine. Create ASM for it. + +``` +0001 ADD +0010 SUB +0011 MUL +0100 DIV +0101 INP +``` + + +--- + +# Programming Languages + +- Early on, programs were written in binary. +- Then to make things simpler, programs were written in Assembly. +- And the progression continued to make higher and higher languages. + +??? +explain the transition + +give examples of ADDR and 00101110 + +e.g. + +``` +01000010 01100001 +``` + +``` +ADD 0xff +``` + +-- + +## Example code + +```python +name = input("What is your name?") +print("Welcome", name) +``` + +--- + +# How do you create apps? + +There are multiple languages that help us in various different tasks + +-- + +- General Purpose Languages are used for a variety of things + + - Python is used in Desktop Apps, Data Science, Machine Learning, Web Servers, etc. + - JS is used for website development, backend development, etc. + - Java is used for servers, Android Applications, etc. + +-- + +- Special Languages help us develop specific things. + - HTML is used for creating content of websites. + - CSS is used for styling webpages. + - XML is used for storing data. + +--- + +# Python + +Python is a general purpose programming language. It is a beginner friendly +programming language. For this session, we will skip the installation but you +can simply install it by downloading the setup from +[python.org](https://python.org). + +We will be using an application called IDLE to run our code. + +??? + +Open IDLE and explain how running the code works and how we can store files and +run the code inside them. Introduce to some basic ideas like using interpreter +as a calculator, stdout and thus print. + +--- + +# Memory and Variables + +Memory is where our program stores data. It is different than Hard Disk as it +is a temporary storage. When we write programs, we store tiny bits of data to +this storage. We can access this data by variables. + +``` +*a = 100 +print(a) + +*b = "Jinal" +print(b) +``` + +??? + +Explain memory in depth. Drop into idle and run the code. Explain that we are +storing data in the memory and print is the command to send it through to +output + +--- + +# Data Types + +Python has various data types. The basic data types available are: + +- Boolean +- Integer +- Float +- String + +??? + +Explain type conversion and introduce to int and float functions. Explain addition on types. + +--- + +# Task: Ask for two numbers and add them + +-- + +```python +str1 = input("Enter Number 1: ") +num1 = int(str1) +``` + +-- + +```python +str2 = input("Enter Number 2: ") +num2 = int(str2) +``` + +-- + +```python +total = num1 + num2 +print(total) +```