-
-
Save khuyentran1401/f50bf670f575ec38a15e4e59da25ec62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from loguru import logger | |
from itertools import combinations | |
def division(num1: int, num2: int): | |
return num1/num2 | |
@logger.catch # Add this to track errors | |
def divide_numbers(num_list: list): | |
for comb in combinations(num_list, 2): | |
num1, num2 = comb | |
res = division(num1, num2) | |
print(f"{num1} divided by {num2} is equal to {res}.") | |
if __name__ =='__main__': | |
num_list = [2, 1, 0] | |
divide_numbers(num_list) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment