Day 2 β
On yesterday's session we talked about on how to setup python and run it on local machine and at the end we executed a simple python code called print.
the code
is used to show the text in the quotation mark to be shown on the terminal. the whole text shown above is called STATEMENT.
Today We are going to see about VARIABLES in python
VARIABLES in python are Containers that store information. think of them like labeled boxes:
Here
and
are labels
and
are the stored values
There are certain rules in naming a variable or variables
βοΈ Must start with a letter
βοΈ Cannot start with a number
βοΈ No spaces (use _ instead)
βοΈ Case-sensitive (Age β age)
βοΈ Avoid reserved words (like for, if, class)
Example
On yesterday's session we talked about on how to setup python and run it on local machine and at the end we executed a simple python code called print.
the code
print("Heloooo")is used to show the text in the quotation mark to be shown on the terminal. the whole text shown above is called STATEMENT.
Today We are going to see about VARIABLES in python
print("What are Variables in Python?")VARIABLES in python are Containers that store information. think of them like labeled boxes:
name = "Abebe"
age = 21
Here
name
and
age
are labels
"Abebe"
and
21
are the stored values
There are certain rules in naming a variable or variables
βοΈ Must start with a letter
βοΈ Cannot start with a number
βοΈ No spaces (use _ instead)
βοΈ Case-sensitive (Age β age)
βοΈ Avoid reserved words (like for, if, class)
Example
first_name = "Kebede"
userAge = 20
π₯°3π₯2π1
Forwarded from INSA Cyber Talent Center
β
Day 3
Python Data Types
These determine what kind of data a variable holds.
πΉ String (str) β text
πΉ Integer (int) β whole numbers
πΉ Float (float) β decimal numbers
πΉ Boolean (bool) β True/False
Python Data Types
These determine what kind of data a variable holds.
πΉ String (str) β text
name = "John"
πΉ Integer (int) β whole numbers
age = 25
πΉ Float (float) β decimal numbers
height = 5.9
πΉ Boolean (bool) β True/False
is_student = True
Checking Data Types
Use
to see the type of a variable:
Use
type()
to see the type of a variable:
x = 10
print(type(x)) # <class 'int'>
Changing Data Types (Type Casting)
age = "20"
age = int(age) # convert string to int
Mini-Exercise for you guys
βοΈ Task:
Create variables to store:
your name
your age
your height
whether you are a student
Then print them out.
Example:
βοΈ Task:
Create variables to store:
your name
your age
your height
whether you are a student
Then print them out.
Example:
name = "Marta"
age = 18
height = 1.65
is_student = True
print(name)
print(age)
print(height)
print(is_student)
π₯4
if you guys are struggling on how to solve it refer to DAY 3 for additional information π
β
DAY 4
Python Operators & Basic Expressions
Operators are symbols that tell Python to perform an action.
Example:
Arithmetic Operators
Used for math operations:
Example
Python Operators & Basic Expressions
print("What Are Operators?")Operators are symbols that tell Python to perform an action.
Example:
a = 10
b = 5
print(a + b)
Arithmetic Operators
Used for math operations:
+ βββ> Addition ββ> 5 + 2
- βββ> Subtraction β-> 5-2
* βββ> Multiplication β> 5 * 2
/ βββ-> Division βββ-> 5/2
// βββ> Floor Division β> 5 // 2
% βββ> Modulus (remainder) β> 5 % 2
** βββ> Power ββββ> 5 ** 2
Example
x = 7
y = 3
print(x*y)
Comparison Operators
They compare two values and return True or False.
They compare two values and return True or False.
== equal to
!= not equal
> greater than
< less than
>= greater or equal
<= less or equal
π2
Logical Operators
Used to combine conditions:
Used to combine conditions:
and both conditions must be true
or at least one condition must be true
not reverses a condition
Assignment Operators
Used to update Variables:
Used to update Variables:
x = 10
x += 5 # x = x + 5
x -= 2 # x = x - 2
x *= 3
x /= 2
Mini Practice Tasks
Task A
Create two numbers and print:
their sum
their difference
their product
their remainder
Task B
Ask the user for age and check if they are above 18:
Task A
Create two numbers and print:
their sum
their difference
their product
their remainder
Task B
Ask the user for age and check if they are above 18:
Hint: Use The input() Function to accept the age:
print("After You done these tasks Try to Build a Simple Calculator Using the Arithmetic and Conditional Operators")β
DAY 5
Conditionals: if and else (Python)
Conditionals are used to make decisions in a program.
Syntax
Example
Output
---
β Uses True/False conditions
β Executes different code blocks
β Very important for beginners
Conditionals: if and else (Python)
print("What are conditionals?")Conditionals are used to make decisions in a program.
Syntax
if condition:
# code runs if condition is True
else:
# code runs if condition is False
Example
age = 18
if age >= 18:
print("You are eligible to vote")
else:
print("You are not eligible to vote")
Output
You are eligible to vote
---
β Uses True/False conditions
β Executes different code blocks
β Very important for beginners
π1
Try to rebuild the calculator using conditionals as well if you have questions then feel free to ask!!
β
DAY 6 Python elif & Nested Conditions
handles two conditions
is used when there are more than two possibilities.
Python checks conditions from top to bottom.
The first True condition runs, the rest are ignored.
β οΈ Order matters!
An if inside another if.
Real Life Example
python
print('Why elif?')
if/else
handles two conditions
elif
is used when there are more than two possibilities.
score = 75
if score >= 90:
print("Grade: A")
elif score >= 70:
print("Grade: B")
else:
print("Grade: C")
print("Flow Of Execution")Python checks conditions from top to bottom.
The first True condition runs, the rest are ignored.
β οΈ Order matters!
print("Nested if Statements")An if inside another if.
age = 20
has_id = True
if age >= 18:
if has_id:
print("Access granted")
else:
print("ID required")
else:
print("Underage")
Real Life Example
balance = 500
if balance > 0:
if balance >= 1000:
print("Premium user")
else:
print("Standard user")
else:
print("No balance")
π₯1
Are you passionate about using #artificialIntelligence to solve real-world problems? Do you have an AI-powered idea or prototype that can improve public services in #Ethiopia?
The Ethiopian Artificial Intelligence Institute invites innovators, researchers, students, startups, and public-interest technologists to apply for Eth-Timbuktoo AI UniPod; a collaborative AI studio focused on building solutions with real public impact.
Participants will work in multidisciplinary teams, receive expert mentorship, and strengthen AI solutions designed for Ethiopiaβs digital and institutional context. This is a unique opportunity to collaborate, learn, and transform innovative ideas into practical tools for better public services.
π Apply here: [https://forms.gle/inHZ9sByu73QsiJP7]
π Application Deadline: December 20, 2025
π Phone: +251 904187791 / +251 943545950
follow π t.me/ignitic_tech
Women applicants are highly encouraged to apply.
Join us and be part of shaping AI for better public services.
The Ethiopian Artificial Intelligence Institute invites innovators, researchers, students, startups, and public-interest technologists to apply for Eth-Timbuktoo AI UniPod; a collaborative AI studio focused on building solutions with real public impact.
Participants will work in multidisciplinary teams, receive expert mentorship, and strengthen AI solutions designed for Ethiopiaβs digital and institutional context. This is a unique opportunity to collaborate, learn, and transform innovative ideas into practical tools for better public services.
π Apply here: [https://forms.gle/inHZ9sByu73QsiJP7]
π Application Deadline: December 20, 2025
π Phone: +251 904187791 / +251 943545950
follow π t.me/ignitic_tech
Women applicants are highly encouraged to apply.
Join us and be part of shaping AI for better public services.