Cours Python AH
Cours Python AH
INTRODUCTION TO
PYTHON
Course Overview
This course offers a comprehensive introduction to Python programming. It
covers the fundamental concepts of programming, including variables, control
structures, data structures such as lists, matrices, and maps (dictionaries),
functions, and file handling. The course emphasizes the development of
problem-solving skills through practical examples and hands-on exercises. By
the end of the course, students will have the ability to write Python programs to
solve a variety of problems across multiple domains.
Learning Objectives
By the end of this course, students will:
• Design and implement Python functions for modular and reusable code.
1
ISTLS Asma HADYAOUI
Course Content
2
ISTLS Asma HADYAOUI
3
ISTLS Asma HADYAOUI
4
ISTLS Asma HADYAOUI
Coding Task 1: Storing Shipment IDs ........................................... Erreur ! Signet non défini.
Coding Task 2: Tracking Cargo Weights ....................................... Erreur ! Signet non défini.
Chapter 6 : Dictionary ........................................................................... Erreur ! Signet non défini.
1. Using a dictionary ......................................................................... Erreur ! Signet non défini.
2. What can be stored in a dictionary? ......................................... Erreur ! Signet non défini.
3. How keys and values in a Dictionary ........................................ Erreur ! Signet non défini.
4. Dictionary Operations: Adding and Removing Items ............ Erreur ! Signet non défini.
5. Assessments .................................................................................. Erreur ! Signet non défini.
Quiz (Multiple Choice) ..................................................................... Erreur ! Signet non défini.
Coding Task 1: Track Delivery Status ............................................ Erreur ! Signet non défini.
Coding Task 2: Warehouse Inventory Management ................. Erreur ! Signet non défini.
Chapter 7: Matrices (Two-Dimensional Arrays)............................ Erreur ! Signet non défini.
1. Defining a Matrix .......................................................................... Erreur ! Signet non défini.
2. Modifying and Traversing a Matrix ........................................... Erreur ! Signet non défini.
3. Traversing Each Element of the Matrix .................................... Erreur ! Signet non défini.
4. Assessments .................................................................................. Erreur ! Signet non défini.
Quiz (Multiple Choice) ..................................................................... Erreur ! Signet non défini.
Coding Task 1: Route Cost Matrix ................................................. Erreur ! Signet non défini.
Coding Task 2: Accessing and Modifying a Matrix ..................... Erreur ! Signet non défini.
Collaborative Project: Transport Fleet Management System........................................50
1. Project Overview.................................................................................................................50
2. Team Structure and Collaboration .................................................................................51
3. Final Deliverables ...............................................................................................................51
4. Grading Criteria ..................................................................................................................51
5. Milestones............................................................................................................................52
Sample Midterm and Final Exams ..........................................................................................53
Proctored exam 2023-2024 ............................................................................................................53
Detailed Proctored Exam Solutions and Explanations ....................................................................55
Final Exam 2022-2023 ....................................................................................................................60
Detailed Final Exam Solutions and Explanations ............................................................................64
5
ISTLS Asma HADYAOUI
References......................................................................................................................................72
Books ..............................................................................................................................................72
Online Documentation and Resources ...........................................................................................72
Research Articles and Academic Resources ...................................................................................73
Useful Python Libraries for Transport and Logistics .......................................................................73
Video Resources and MOOCs .........................................................................................................74
6
ISTLS Asma HADYAOUI
Pre-Test
7
ISTLS Asma HADYAOUI
c) Circle
d) Matrix
Q9: Variables in Python must be declared with their data types (e.g., int, string).
(True / False)
Q11: In Python, how would you print "Hello, World!" to the console?
Answer:
Q12: What is a Python list? Write an example of a list that contains three
numbers.
Answer:
8
ISTLS Asma HADYAOUI
Q16: Write a Python program that asks the user for their name and prints a
welcome message.
python
Copier le code
Q17: Write a Python function that takes two numbers as input and returns their
sum.
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
Q18: Write a Python program that prints all the even numbers from 1 to 20
using a loop.
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………….
9
ISTLS Asma HADYAOUI
Q19: You are organizing a transport schedule. A driver can take up to 8 hours to
make a delivery. You have 24 hours to schedule the deliveries. How many
drivers do you need if each driver can only work for 8 hours?
Answer:
Answer:
Pre-Test Evaluation
• 30 - 35 Points: Strong foundation in programming and Python; student
may be ready for more advanced topics in the course.
10
ISTLS Asma HADYAOUI
print("Hello, world!")
Sample output
Hello, world!
Sample output
Row, row, row your boat,
Gently down the stream.
Merrily, merrily, merrily, merrily,
Life is but a dream.
This exercise will help you practice how to print multi-line strings in
Python.
11
ISTLS Asma HADYAOUI
Example1:
print(3 + 5) # Addition
print(4 * 2) # Multiplication
print(8 - 3) # Subtraction
print(16 / 4) # Division
Sample output
8
8
5
4.0
Example 2:
print("4 + 3 * 10")
Sample output
34
12
ISTLS Asma HADYAOUI
3. Commenting
In Python, comments are used to explain the code and are ignored
when the program runs. Comments start with the # symbol and can be
used to make your code easier to understand.
Example:
4. Variables in Python
A variable is a named location used to store data in a program. You can
assign values to variables and then use them throughout your code.
Here's an example:
13
ISTLS Asma HADYAOUI
variable values directly into your string, making it more flexible and
readable.
Example:
age = 25
print(f"I am {age} years old.")
Output:
I am 25 years old.
14
ISTLS Asma HADYAOUI
Sample output
Profile of Ahmed Ben Youssef:
Age: 30
Skills:
1. Web Development - Advanced
2. Mobile App Development - Intermediate
Desired Salary: 2500 to 4000 TND per month
6. Assessments
Quiz (Multiple Choice)
15
ISTLS Asma HADYAOUI
Write a Python program that calculates the total delivery cost based on the
distance (in km) and the cost per kilometer. The program should ask the user
for the distance traveled and the cost per kilometer, then display the total cost.
Expected Output:
16
ISTLS Asma HADYAOUI
17
ISTLS Asma HADYAOUI
Example Output
How old are you? 20
You are eligible to apply for a driving license!
If the user enters an age below 18, the output would be:
Example output
How old are you? 16 Next customer, please How old are you? 16
You are too young to apply for a driving license.
18
ISTLS Asma HADYAOUI
if temperature < 0:
print("It is freezing!")
elif temperature > 35:
print("It is too hot!")
else:
print("The weather is moderate.")
Example Output:
It is too hot!
1.2. Indentation
19
ISTLS Asma HADYAOUI
items_in_cart = 5
is_member = True
Expected Output:
20
ISTLS Asma HADYAOUI
Example Output 1:
x = symbols('x')
21
ISTLS Asma HADYAOUI
roots = solve(equation, x)
Sample output
Enter coefficient a: 1
Enter coefficient b: -6
Enter coefficient c: 11
Enter constant d: -6
The real roots are: [1, 2, 3]
2. if-else Statements
The if-else structure allows you to provide an alternative action when the
if condition is not met.
22
ISTLS Asma HADYAOUI
if number % 2 == 0:
print("The number is even.")
else:
print("The number is odd.")
Example output
Enter a number: 7
The number is odd.
23
ISTLS Asma HADYAOUI
When there are more than two possible outcomes, the elif statement
comes in handy.
24
ISTLS Asma HADYAOUI
Write a program that takes two city names from the user and prints
which one comes first alphabetically.
Example output
Enter the first city: Tunis
Enter the second city: Sfax
Sfax comes first alphabetically.
4. Combining conditions
You can combine multiple conditions using the and or logical
operators.
25
ISTLS Asma HADYAOUI
Sample output
Enter a number: 15
26
ISTLS Asma HADYAOUI
Write a program that asks for three different letters and prints out the
one that would be in the middle if sorted alphabetically.
Write a program that calculates the sales tax for an item based on its
price and the type of item. Use the following tax rates:
Example output
Enter the price of the item: 100
Enter the type of item (food/electronics/luxury): electronics
The tax is 10%, so the total price is 110.
5. Assessments
Quiz (True/False)
Write a Python program that checks if a vehicle is overloaded. If the total load
exceeds 5000 kg, print a warning message. Otherwise, print the current load.
Expected Output:
27
ISTLS Asma HADYAOUI
Write a Python program that checks whether a shipment is eligible for free
shipping. The conditions are :
If both conditions are true, print "Free shipping eligible". Otherwise, print the
cost of shipping (5 TND per kilometer).
Expected Output:
28
ISTLS Asma HADYAOUI
Chapter 3: Loops
Loops allow us to repeat sections of code multiple times, making them
essential for automating tasks, especially in fields like transport and
logistics where repetitive processes, such as tracking shipments,
calculating fuel consumption, or monitoring warehouse inventory, are
common. In this chapter, we will explore various looping structures in
Python.
1. while loop
The while loop repeats a block of code as long as a specified condition
is true. It is particularly useful for processes that require continuous
monitoring or until a specific event occurs.
In logistics, you may need to track the fuel level of trucks. This loop
continues to monitor the fuel level, asking the driver to refuel when the
level falls below a certain threshold, and stops when the level is at an
acceptable level or the user types -1 to quit.
while True:
fuel_level = int(input("Enter the truck's fuel level in liters (-1 to quit): "))
if fuel_level == -1:
break
29
ISTLS Asma HADYAOUI
Sample output
Enter the truck's fuel level in liters (-1 to quit): 15
Warning: Low fuel! Please refuel the truck.
Enter the truck's fuel level in liters (-1 to quit): 50
Current fuel level: 50 liters.
Enter the truck's fuel level in liters (-1 to quit): -1
Fuel monitoring stopped.
while True:
pin = input("Enter the security PIN to access cargo information: ")
if pin == "4321":
break
print("Incorrect PIN. Try again.")
30
ISTLS Asma HADYAOUI
Write a program that prints the message "Cargo is being checked" and
asks, "Shall we continue?" until the user inputs "no". The program
should end by printing "Cargo check stopped."
Sample output
Cargo is being checked
Shall we continue? yes
Cargo is being checked
Shall we continue? no
Cargo check stopped.
attempts = 0
max_attempts = 3
success = False
while attempts < max_attempts:
pin = input("Enter the security PIN: ")
attempts += 1
if pin == "4321":
success = True
break
else:
print("Incorrect PIN.")
31
ISTLS Asma HADYAOUI
if success:
print("Correct PIN entered! Access granted.")
else:
print("Too many attempts. Access blocked.")
Sample output
Enter the security PIN: 1234
Incorrect PIN.
Enter the security PIN: 4321
Correct PIN entered! Access granted.
Write a program that keeps asking for the correct PIN (4321). The
program should display the number of attempts it took to enter the
correct PIN. If the user gets it right on the first try, print a special
message.
Sample output 1
Enter the PIN: 3245
Wrong PIN.
Enter the PIN: 1234
Wrong PIN.
Enter the PIN: 4321
Correct! It took you 3 attempts.
Sample output 2
Enter the PIN: 4321
Correct! It only took you one attempt!
32
ISTLS Asma HADYAOUI
This program stores all entered shipment IDs in a string and prints
them at the end.
shipment_ids = ""
attempts = 0
while True:
shipment_id = input("Enter the shipment ID: ")
attempts += 1
shipment_ids += shipment_id + ", "
if attempts == 3:
break
Sample output:
33
ISTLS Asma HADYAOUI
while <condition>:
<block>
This loop continues checking the cargo load and increments the value
until the load reaches the capacity of the truck.
Sample output
Enter the current load: 3000
34
ISTLS Asma HADYAOUI
If any one of these three components is missing, the loop will likely not
function correctly.
Write a program that prints all the even numbers between 2 and 50.
Use a loop to iterate through the numbers and print each one on a
separate line.
Sample output
2
4
6
...
50
35
ISTLS Asma HADYAOUI
The program below contains an error. Fix the code to make it print a
countdown starting from a number entered by the user, and ending
with "Now!".
Sample output
Are you ready?
Enter a number: 5
5
4
3
2
1
Now!
36
ISTLS Asma HADYAOUI
Sample output
Enter a starting number: 28
28
31
34
Sample output
Enter a starting number: 96
96
+99
Write a program that asks the user for a number. The program then
prints all integer numbers greater than zero but smaller than the input.
Sample output
Upper limit: 5
6. Assessments
Quiz (Short Answer)
37
ISTLS Asma HADYAOUI
1. Which loop should you use when the number of iterations is unknown?
for i in range(3):
print(i)
a) 0 1 2 3
b) 1 2 3
c) 0 1 2
d) 3 2 1
count = 0
38
ISTLS Asma HADYAOUI
count += 1
print(count)
a) 4 times
b) 5 times
c) 6 times
d) Infinite times
Write a Python program that keeps asking the user for the fuel level of a truck
(in liters). If the fuel level is less than 20 liters, print a warning. The program
should stop when the user enters -1.
Expected Output:
Write a Python program that keeps asking the user for container weights until
the total weight exceeds 10,000 kg. Then, display the total weight and the
number of containers loaded.
Expected Output:
39
ISTLS Asma HADYAOUI
40
ISTLS Asma HADYAOUI
1. Function Introduction
A function is a block of organized, reusable code that performs a specific task.
Functions help in breaking down large programs into smaller, more
manageable pieces. You can pass information to a function using parameters,
and a function can return a result, such as the distance between two locations
or the fuel needed for a trip.
Key Features:
2. Function Definition
A function is defined using the keyword def:
Example
def my_function():
41
ISTLS Asma HADYAOUI
my_function()
def delivery_message():
delivery_message()
Output:
3. Function Parameters
Parameters allow you to pass data to functions, making them more dynamic.
For instance, you might pass the distance or weight of cargo to a function to
calculate costs or fuel requirements.
Example
def my_function(parameter):
my_function("to code!")
42
ISTLS Asma HADYAOUI
my_function("to do AI!")
This function accepts the distance traveled as a parameter and prints the
estimated fuel consumption.
def calculate_fuel(distance):
calculate_fuel(100)
calculate_fuel(250)
You can add as many parameters as you want. Just separate them with a
comma.
Example
my_function("Hey", "you!")
43
ISTLS Asma HADYAOUI
You can set default parameters for your functions. This is useful when one of
the parameters rarely changes, such as a default fuel price in your region.
Example
def my_function(country="Tunisia"):
my_function("Maroc")
my_function("Algeria")
my_function()
Output:
44
ISTLS Asma HADYAOUI
4. Return Statement
To return a value from a function we can use the return statement :
Example
def my_function(x):
return 5*x
print(my_function(0))
print(my_function(1))
print(my_function(2))
5. Lambda Function
5.1. Definition
A lambda function:
• Is a small function.
• Can take any number of arguments, but should have only one
expression.
5.2. Syntax
45
ISTLS Asma HADYAOUI
Example
print(sum(2,6,3))
ch = "20221121"
print(year(ch)) #2022
You can use a lambda function to quickly calculate the total weight of cargo in a
shipment.
500
6. Map Function
The map() function is a function that applies a specific instruction on each
item of an iterable or more.
The items and the instructions are sent to the map function as parameters:
46
ISTLS Asma HADYAOUI
def km_to_miles(km):
Output:
7. Assessments
Quiz (True/False)
47
ISTLS Asma HADYAOUI
return a + b
print(add_numbers(2, 3))
a) 5
b) 2
c) 3
d) Syntax error
48
ISTLS Asma HADYAOUI
Expected Output:
Expected Output:
49
ISTLS Asma HADYAOUI
1. Project Overview
The Transport Fleet Management System will be divided into several
components, each representing a critical part of fleet and logistics
management. The team will collectively build and integrate the following
features:
50
ISTLS Asma HADYAOUI
3. Final Deliverables
1. Source Code Repository: The full Python code for the Transport Fleet
Management System, organized into modules.
4. Grading Criteria
• Functionality (40%): The system must work as intended, with all features
implemented and functioning properly.
• Collaboration and Teamwork (20%): Each team member should
contribute to the project, and there should be evidence of effective
collaboration.
• Code Quality (20%): The code should be well-organized, documented, and
follow good programming practices.
• Presentation (10%): The demo video and project report should clearly
explain the system’s features and demonstrate its functionality.
• Creativity and Problem-Solving (10%): Bonus points for creative solutions,
additional features, or optimizations that enhance the system.
51
ISTLS Asma HADYAOUI
5. Milestones
Week Milestone Key Deliverables
Week 1 Project Kickoff & Team Formation Team roster, Project outline,
Repository
Week 2 System Architecture & Module Architecture diagram, Module
Specifications specs
Week 3 Initial Module Development Initial implementation, Unit
tests
Week 4 Module Integration & Data Integrated system, Integration
Sharing tests
Week 5 Final Development & Testing Fully functional system, Te*st
reports
Week 6 Final Presentation & Submission Final code, Demo video, Project
report
52
ISTLS Asma HADYAOUI
Proctored exam
Algorithmics and programming I
Groups: TIT1 Mrs. Asma Hadyaoui
Date: 07-11-2023 Duration:1h
• Documents NOT allowed
53
ISTLS Asma HADYAOUI
For each Python code snippet provided, predict the output that would appear when the
code is executed. Write "Error" if you believe the code would not run successfully due to
a syntax or logical error.
a.
print(10 // 3)
b.
c.
x = True
y = False
print(x and y)
d.
1. Create a Python function named calculate_area that takes two arguments, length
and width, and returns the area of a rectangle.
2. Provide a detailed explanation for what the code below is intended to do:
word = "programming"
for letter in word:
if letter in "aeiou":
print(letter, end=" ")
54
ISTLS Asma HADYAOUI
Please write a program that asks the user for a positive integer N. The program then prints
out all numbers between -N and N inclusive but leaves out the number 0. Each number
should be printed on a separate line.
Sample output
Please type in a positive integer: 4
-4
-3
-2
-1
1
2
3
4
Good Luck ☺
55
ISTLS Asma HADYAOUI
print(10 // 3)
Answer: 3
Explanation: The // operator performs integer division, which divides two
numbers and returns the quotient without the remainder.
if char == "H":
break
print(char)
Answer:
Explanation: The loop iterates over each character in the string "PYTHON".
When it encounters "H", the break statement stops the loop, so "P", "Y", and "T"
are printed.
56
ISTLS Asma HADYAOUI
x = True
y = False
print(x and y)
Answer: False
Explanation: The and operator returns True only if both operands are True.
Since x is True and y is False, the result is False.
if i % 2 == 0:
print(i)
Answer:
10
Explanation: The code prints even numbers between 1 and 10. The condition i %
2 == 0 checks if the number is divisible by 2, and only even numbers are printed.
Answer:
57
ISTLS Asma HADYAOUI
Explanation: This function takes two arguments (length and width) and
multiplies them to return the area of the rectangle. The formula for the area of
a rectangle is length * width.
word = "programming"
if letter in "aeiou":
Explanation:
This code iterates through each letter in the string "programming". For each
letter, it checks if the letter is a vowel ("a", "e", "i", "o", or "u"). If the letter is a
vowel, it is printed without moving to the next line (end=" " keeps all printed
vowels on the same line). The output will be:
oai
Write a program that asks the user for a positive integer N. The program
then prints out all numbers between -N and N inclusive but leaves out the
number 0. Each number should be printed on a separate line.
Answer:
58
ISTLS Asma HADYAOUI
if i != 0:
print(i)
Explanation:
Sample Output:
-4
-3
-2
-1
59
ISTLS Asma HADYAOUI
Final exam
Programming I
Groups: TIT1 + ST1 + GL1 Mrs. Asma Hadyaoui
60
ISTLS Asma HADYAOUI
a.
a_dict = {'color': 'blue', 'fruit': 'apple', 'pet': 'dog'}
for key in a_dict:
print(key)
b.
func = lambda x: return x
print(func(2))
c.
for num in range(1, 5):
print(num)
d.
x=0
while x < 10:
x=x+1
print(x)
Example 1:
61
ISTLS Asma HADYAOUI
chessboard(3)
print()
Sample output
101
010
101
Example 2:
chessboard(6)
print()
Sample output
101010
010101
101010
010101
101010
010101
• Write a function that allows the changing of the value of a single element
within the matrix (“changement de la valeur d'un seul élément de la matrice”).
• Write a function that increases the value of each element in the matrix by one
(“ajoute 1 à chaque élément de la matrice”).
• Write the program that defines this matrix and then call these functions.
62
ISTLS Asma HADYAOUI
Write a program that asks the user to choose between addition and removal. Depending on
the choice, the program adds an item to or removes an item from the end of a list. The item
that is added must always be one greater than the last item in the list. The first item to be
added must be 1 (“Selon le choix effectué,le programme ajoute ou retire un élément à la fin
d'une liste. L'élément qui est ajouté doit toujours être supérieur de 1 au dernier élément de
la liste. Le premier élément à ajouter doit être 1”).
The list is printed out after each operation. Have a look at the example execution below:
Sample output
The list is now []
a(d)d, (r)emove or e(x)it: d
The list is now [1]
a(d)d, (r)emove or e(x)it: d
The list is now [1, 2]
a(d)d, (r)emove or e(x)it: d
The list is now [1, 2, 3]
a(d)d, (r)emove or e(x)it: r
The list is now [1, 2]
a(d)d, (r)emove or e(x)it: d
The list is now [1, 2, 3]
a(d)d, (r)emove or e(x)it: x
Bye!
Good Luck ☺
63
ISTLS Asma HADYAOUI
• Explanation:
• Answer: True
b. 123 == "123"
• Explanation:
• Answer: False
64
ISTLS Asma HADYAOUI
• Correct definition:
my_dict = {
"color": "blue",
"fruit": "apple",
"pet": "dog"
a.
print(key)
• Explanation: The code iterates over the dictionary's keys and prints each
key.
• Answer:
65
ISTLS Asma HADYAOUI
color
fruit
pet
b.
print(func(2))
• Answer: Error
c.
print(num)
• Answer:
d.
x=0
66
ISTLS Asma HADYAOUI
x=x+1
print(x)
• Explanation: The while loop increments x until it reaches 10, and then
the loop stops. After the loop, x is printed.
• Answer:
10
• Solution:
def chessboard(n):
for i in range(n):
row = ""
for j in range(n):
if (i + j) % 2 == 0:
row += "1"
else:
row += "0"
print(row)
# Example calls
67
ISTLS Asma HADYAOUI
chessboard(3)
print()
chessboard(6)
• Explanation:
o The function uses two nested loops. The outer loop iterates
through rows, and the inner loop builds each row by alternating
between 1 and 0 based on the sum of the row and column indices
(i + j) % 2.
101
010
101
101010
010101
101010
010101
101010
010101
Solution:
68
ISTLS Asma HADYAOUI
matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
matrix[row][col] = new_value
def increment_matrix(matrix):
for i in range(len(matrix)):
for j in range(len(matrix[i])):
matrix[i][j] += 1
# Example usage
print(matrix)
• Explanation:
69
ISTLS Asma HADYAOUI
• Sample output:
Task: Write a program that allows the user to either add or remove an item
from the end of a list. The item added should always be one greater than the
last item, and the first item added should be 1.
• Solution:
def list_operations():
lst = []
while True:
if choice == 'd':
if lst:
lst.append(lst[-1] + 1)
else:
lst.append(1)
if lst:
lst.pop()
70
ISTLS Asma HADYAOUI
print("Bye!")
break
else:
# Example usage
list_operations()
• Explanation:
o The program maintains a list that starts empty. The user can add
items by choosing d, remove items by choosing r, or exit by
choosing x.
• Sample output:
Bye!
71
ISTLS Asma HADYAOUI
References
Books
1. "Python Crash Course" by Eric Matthes (2nd Edition, 2019)
This is a fast-paced, hands-on introduction to programming with Python. It
covers basic concepts and helps students build projects as they learn.
72
ISTLS Asma HADYAOUI
3. Real Python
https://realpython.com/
This site offers tutorials, articles, and guides on various Python topics, from beginner
concepts to advanced programming techniques.
73
ISTLS Asma HADYAOUI
1. Pandas
https://pandas.pydata.org/
Pandas is a data manipulation and analysis library that is highly useful for
working with tabular data (e.g., shipments, routes, fuel consumption data).
2. NumPy
https://numpy.org/
NumPy is a library for numerical computing with Python. It is useful for
performing complex mathematical operations in logistics calculations (e.g.,
distances, loads).
3. Matplotlib and Seaborn
https://matplotlib.org/ and https://seaborn.pydata.org/
These are libraries for creating visualizations. They help in plotting charts and
graphs related to logistics data (e.g., fuel efficiency, shipment trends).
4. Scikit-learn
https://scikit-learn.org/stable/
A machine learning library in Python, which can be used to implement
predictive models for transportation optimization and logistic solutions.
5. Geopy
https://geopy.readthedocs.io/
This library is useful for geocoding, distance calculations, and finding
locations based on coordinates, relevant for logistics routing problems.
74
ISTLS Asma HADYAOUI
75