<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Ikkinchi darajali tenglamalarni hisoblash uchun Python funksiyalarini dasturlash<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Albatta, Python-da ikkinchi darajali tenglamani yechish uchun, biz funksiya yarata olamiz, u tenglamaning koeffitsiyentlarini kiritadi va uning yechimlarini hisoblaydi. Mana sizga misol: def equation_second_degree ((a, b, c): if a == 0: raise ValueError ((("Koefitsiyent "a" nol bo'lishi mumkin emas, chunki u ikkinchi darajali tenglama bo'lmasdi. ") discriminant = b**2 - 4*a*c if discriminant < 0: raise ValueError (("Tegalashning haqiqiy yechimi yo'q. ") x1 = (-b + math.sqrt(discriminant)) (2 * a) x2 = (-b - math.sqrt(discriminant)) (2 * a) x1, x2 Esingizda bo'lsin, math funksiyasidan foydalanish uchun siz<|eot_id|>