Step 1
1. Go to the official website at Python Software Foundation
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.python.org/downloads/release/python-3119/&ved=2ahUKEwiln7je2q6RAxWihP0HHX_MHQEQFnoECB0QAQ&usg=AOvVaw3wuTDRpUtxhIl_4eJGGQe-
1. Go to the official website at Python Software Foundation
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.python.org/downloads/release/python-3119/&ved=2ahUKEwiln7je2q6RAxWihP0HHX_MHQEQFnoECB0QAQ&usg=AOvVaw3wuTDRpUtxhIl_4eJGGQe-
π₯1
πππ Python 3.11.9 is downloaded because itβs a very stable and fast version that works well with most libraries.
Itβs also widely supported, making it a safe choice for beginners and developers.
Itβs also widely supported, making it a safe choice for beginners and developers.
Step 2
Run the downloaded .exe file. Important: check the box βAdd Python to PATHβ and also βInstall launcherβ. Then click Install Now.
Run the downloaded .exe file. Important: check the box βAdd Python to PATHβ and also βInstall launcherβ. Then click Install Now.
Step 3
After installation completes, open Command Prompt (cmd) and type:
or
to verify installation. It should display a version like Python 3.11.9
After installation completes, open Command Prompt (cmd) and type:
python --version
or
python3 --version
to verify installation. It should display a version like Python 3.11.9
STEP 1 β
First check if Python 3 is already installed. Open a terminal and run:
If it shows something like Python 3.x.x, youβre good to go.
STEP 2 β
If not installed (or you want a newer version), use your distributionβs package manager. For Debian/Ubuntu-based systems, youβd run something like:
This installs Python 3 (and pip, the package manager).
STEP 3 β
After installation, verify with:
First check if Python 3 is already installed. Open a terminal and run:
python3 --version
If it shows something like Python 3.x.x, youβre good to go.
STEP 2 β
If not installed (or you want a newer version), use your distributionβs package manager. For Debian/Ubuntu-based systems, youβd run something like:
sudo apt update
sudo apt install python3 python3-pip
This installs Python 3 (and pip, the package manager).
STEP 3 β
After installation, verify with:
python3 --version
Do you want a video, or is this okay?
Anonymous Poll
33%
Yes! video for better understanding
67%
No... this ok
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 π