06:44
1,0×
00:00/06:44
505,4 тыс смотрели · 4 года назад
Python sets
In Python, a Set is an unordered collection of Unique elements. This means that a set cannot contain duplicate values. Sets are implemented using a hash table, which allows for very fast membership testing (checking if an element is in the set) and fast insertion and deletion of elements. Key Characteristics of Sets: Unordered: The elements in a set have no specific order. You cannot access elements by index like you can in a list. Unique: Sets only store unique elements. If you try to add a duplicate element, it will be ignored. Mutable: You can add or remove elements from a set after it has been created...
4 года назад
3 инструмента для отслеживания и визуализации выполнения кода на Python
Источник: Nuances of Programming Для чего нужны новые инструменты? Видели когда-нибудь такой вывод ошибок? 2 divided by 1 is equal to 2.0. Traceback (most recent call last): File "loguru_example.py", line 17, in <module> divide_numbers(num_list) File "loguru_example.py", line 11, in divide_numbers res = division(num1, num2) File "loguru_example.py", line 5, in division return num1/num2 ZeroDivisionError: division by zero А хотели бы, чтобы вывод был немного более понятным и наглядным?...