+ 1

Who can help me to correct this code

The code is about library https://www.sololearn.com/discuss/3222797/?ref=app

24th Jun 2023, 4:07 PM
Mohamed Amandar
Mohamed Amandar - avatar
5 Réponses
+ 4
Don't spam
24th Jun 2023, 4:09 PM
A͢J
A͢J - avatar
+ 2
Don't post a question more than once.
24th Jun 2023, 4:10 PM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 1
Where is your code? I have click the link that you have posted in your question, but it says that it can`t find it, because you have deleted the code. Please upload the code and post it here as soon as possible, or remove this post immediately, as it is misleading. Thank you.
26th Jun 2023, 9:22 AM
Danish Zubair
Danish Zubair - avatar
0
import pickle class Carte: def __init__(self, titlu, autor): self.titlu = titlu self.autor = autor self.client_imprumutat = None self.clienti_asteptare = [] def adauga_client_asteptare(self, client): self.clienti_asteptare.append(client) def returneaza_carte(self): if self.client_imprumutat: self.client_imprumutat.nr_carti_imprumutate -= 1 self.client_imprumutat = None if self.clienti_asteptare: primul_client = self.clienti_asteptare.pop(0) self.client_imprumutat = primul_client primul_client.nr_carti_imprumutate += 1 class Client: def __init__(self, nume): self.nume = nume self.nr_carti_imprumutate = 0 class Biblioteca: def __init__(self): self.carti = [] self.clienti = [] def cauta_carte(self, titlu): for carte in self.carti: if carte.titlu == titlu: return carte return None def adauga_carte(self, carte): self.carti.append(carte) def sterge_carte(self, carte): self.carti.remove(carte) def adauga_client(self, client): self.clienti.append(client) def serializeaza(self, fisier): with open(fisier, 'wb') as f: p
26th Jun 2023, 9:27 AM
Mohamed Amandar
Mohamed Amandar - avatar
0
Mohamed Amandar Share your attempt and your code link, instead of sharing different OOP objects.
26th Jun 2023, 10:40 AM
Danish Zubair
Danish Zubair - avatar