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.