PROGRAM AI-1
Revision
(Chapter 1 - 13)
Revision (Basic of Python & Packages)
Introductionand Setup
Python Programming
Jupyter Notebook(Google Colab)
File extension: .ipynb
Data type and manipulation
Revision (Basic of Python & Packages)
Variable
Cannot Do ❌ :
Variable and Data types
Example | Data type(variable) |
“Hello World” | string (str) |
999 | integer (int) |
3.145 | real number (float) |
False | boolean (bool) |
[“tiger”, “cat”, “dog”] | list (list) |
(“tiger”, “cat”, “dog”) | tuple (tuple) |
{“animal”: “tiger”, “type”: “carnivore”} | dictionary (dict) |
Operator and operands
Operator | Operation | Example |
+ | Addition | x + y |
- | Subtraction | x - y |
* | Multiplication | x * y |
/ | Division | x / y |
** | Power(Exponential) | x ** y |
% | Remainder | x % y |
Basic Syntax
Data Structure
Revision (Basic of Python & Packages)
List vs Dictionary
Differences | List | Dictionary |
Sequence | ordered | unordered |
Access item | index | key |
Symbol | [] | {} |
List
Dictionary
Logic and Selection
Revision (Basic of Python & Packages)
Conditional Statement
if state == “Hungry” :
Eat()
condition
indentation
Code to execute
Comparison ==, Assign =
For Loop
for item in sequence:
Block of codes to execute
[1, 2, 3, 4, 5]
First item > Second item > … > Last item
print(item)
while condition:
Block of codes to execute
While Loop
When
it is true
Define and use
Revision (Basic of Python & Packages)
def function_name(parameters):
Block of codes to execute
return(optional)
Function
Define/Create
function_name(arguments)
Call
We need to install and import.
Package
Useful Packages
Revision (Basic of Python & Packages)
NumPy array
PrettyTable
Easy to understand
Revision (Basic of Python & Packages)
Statistical concept
Descriptive Statistics
Descriptive Statistics
Revision (Basic of Python & Packages)
Graph figure
Data Visualization using Matplotlib
Components of Figure
Title
x-axis
y-axis
Label
Graphs
Legend
All the best for Quiz 1