class Student:
def __init__(self, student_id, name):
self.student_id = student_id
self.name = name
class Book:
def __init__(self, book_name, isbn):
self.book_name = book_name
self.isbn = isbn
]]>
def distribute_book(book_list, student_list, book_name, student_id):
for book in book_list:
if book.book_name == book_name:
for student in student_list:
if student.student_id == student_id:
print(f"Student {student.name} has received the book {book.book_name}.")
return
print("Student ID not found.")
return
print("Book not found.")
]]>
students = [Student(1, "Alice"), Student(2, "Bob")]
books = [Book("Python Basics", "978-3-16-148410-0"), Book("Java Programming", "978-0-13-110163-3")]
distribute_book(books, students, "Python Basics", 1)
]]>