03 Programming in Python 🚀 Â
Binary Number System

We humans use a decimal, or base-10, numbering system, presumably because people have 10 fingers
Â
Early computers were designed around the decimal numbering system. This approach made the creation of computer logic capabilities unnecessarily complex and did not make efficient use of resources. (For example, 10 vacuum tubes were needed to represent one decimal digit.)
Â

Story behind
 To deal with the basic electronic states of on and off, Von Neumann suggested using the binary numbering system
Conversions
- Binary Number to Decimal
- Decimal Number to Binary
Quiz Time 🔥Â
Programming in Python
Python Interpreter
You write your Python code in a text file with a name like hello.py. How does that code Run?
Â
There is program installed on your computer named "python3" or "python", and its job is looking at and running your Python code. This type of program is called an "interpreter".
Â

Extra Reading Material [Blog]
How Python Runs
Software Tools [Recommended] 🤔
Python 3
https://www.python.org/download/releases/3.0/
Â
Â
Jupyter Notebook
https://jupyter.org/install
Â
Â
Interactive Shell
Command LineÂ
Installation with pip
If you use pip, you can install it with:
Â
pip install notebook
Â
Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows):
Â
jupyter notebook
Â
Juypyter Shortcuts!!!
First Python Program
print("Hello")
First Java Program
Boilerplate Code
//Boilerplate Code
class Main
{
public static void main (String[] args)
{
//Your Code goes here
}
}
Let's learn Python syntax!
Â
1. Hello Python
2. Variables & Data types
3. Typecasting
4. Branching
Â
Next Class
3. Loops
4. More constructs
Variables & Datatypes

Buckets can have
different Sizes!
Size of a "Bucket"
sys.getsizeof(x)
Read Principal, Rate & Time and print Simple Interest.
Sample Input
P = 100
R = 5
T = 2
Â
Sample Output
SI = 10
Simple Interest Calculator


Read 3 Numbers and find their largest.
Sample Input
10
50
40
Â
Sample Output
50
Largest of 3 Numbers


Branching
if/else tests - do something under this condtionÂ
Â
Conditional Statements
Single If
marks = 90
if marks > 90:
# do some work
print("Great job")

[Python 03] Introduction to Python, Number Systems
By Prateek Narang
[Python 03] Introduction to Python, Number Systems
- 10