Forwarded from Javlonbek Boβriyev
def mynew():
try:
num = int(input("Enter a number: "))
assert num % 2 == 0, "Essert ishladi"
except:
print("Not an even number!")
else:
reciprocal = 1/num
print(reciprocal)
finally:
print("Ishlayapman! ... ")
mynew()
mynew()
try:
num = int(input("Enter a number: "))
assert num % 2 == 0, "Essert ishladi"
except:
print("Not an even number!")
else:
reciprocal = 1/num
print(reciprocal)
finally:
print("Ishlayapman! ... ")
mynew()
mynew()
1. Chiziqli algoritmlarni dasturlash
2. Butun sonlar ustida amallar
3. Shartli operatorlar
4. Tanlash operatorlari
5. Sikl operatorlari
6. Shartli sikl operat
7. Ketma-ketliklar
8. Massivlar ustida amallar
9. Ikki oβlchovli massivlar ustida amallar
10. Metodlar ustida amallar
11. Murakkab turli metodalar ustida amallar
12. Klasslar
2. Butun sonlar ustida amallar
3. Shartli operatorlar
4. Tanlash operatorlari
5. Sikl operatorlari
6. Shartli sikl operat
7. Ketma-ketliklar
8. Massivlar ustida amallar
9. Ikki oβlchovli massivlar ustida amallar
10. Metodlar ustida amallar
11. Murakkab turli metodalar ustida amallar
12. Klasslar
class Book:
book_type = "O'ylangan"
def init(self, book_name, book_author):
self.book_name = book_name
self.book_author = book_author
def kitob(self):
return f"{self.book_name} kitobi muallifi {self.book_author}, kitob {self.book_type} kitoblar toifasiga kiradi."
def change_name_book(self, new_name):
eski_oti = self.book_name
self.book_name = new_name
return f"{eski_oti} kitobi {self.book_name}-ga o'zgartirildi"
def change_name_author(self, new_author):
eski_oti_author = self.book_author
self.book_author = new_author
return f"{eski_oti_author} shu odam bunisiga o'zgartirildi ---> {self.book_author}"
book1 = Book("Eski shaxar", "Sadibekov Alisher")
book2 = Book("Kerakli odam", "Maxmadaliyev Sohib")
book3 = Book("Jonli ijro", "G'ayratov Nodir")
print("[=========================================================================================================================]")
print(book1.kitob())
print("[----------------------------------------------------------------------------------]")
print(book2.kitob())
print("[----------------------------------------------------------------------------------]")
print(book3.kitob())
print("[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]")
print(book1.change_name_book("Kumush kino"))
print("[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]")
print(book2.change_name_author("Usmanov Kazbek"))
print("[===========================================================================================================================]")
book_type = "O'ylangan"
def init(self, book_name, book_author):
self.book_name = book_name
self.book_author = book_author
def kitob(self):
return f"{self.book_name} kitobi muallifi {self.book_author}, kitob {self.book_type} kitoblar toifasiga kiradi."
def change_name_book(self, new_name):
eski_oti = self.book_name
self.book_name = new_name
return f"{eski_oti} kitobi {self.book_name}-ga o'zgartirildi"
def change_name_author(self, new_author):
eski_oti_author = self.book_author
self.book_author = new_author
return f"{eski_oti_author} shu odam bunisiga o'zgartirildi ---> {self.book_author}"
book1 = Book("Eski shaxar", "Sadibekov Alisher")
book2 = Book("Kerakli odam", "Maxmadaliyev Sohib")
book3 = Book("Jonli ijro", "G'ayratov Nodir")
print("[=========================================================================================================================]")
print(book1.kitob())
print("[----------------------------------------------------------------------------------]")
print(book2.kitob())
print("[----------------------------------------------------------------------------------]")
print(book3.kitob())
print("[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]")
print(book1.change_name_book("Kumush kino"))
print("[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]")
print(book2.change_name_author("Usmanov Kazbek"))
print("[===========================================================================================================================]")