47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
| [Ссылка на урок](https://youtu.be/XnWORRJVDfw?si=jsBtVj0EW-UPk3qM)
 | ||
| 
 | ||
| ### List (Списки, похожи на массивы в 1С) ###
 | ||
| ```python
 | ||
| price = [75, 80, 15, 41]
 | ||
| print(type(price), price)
 | ||
| print(price[0], price[1])
 | ||
| price.append(23)
 | ||
| print(price)
 | ||
| price.insert(0, 8)
 | ||
| print(price)
 | ||
| del price[0]print(price)
 | ||
| price.remove(15)
 | ||
| print(price)
 | ||
| print(80 in price)
 | ||
| print(max(price))
 | ||
| print(min(price))
 | ||
| 
 | ||
| price.append("строка")
 | ||
| print(price)
 | ||
| ```
 | ||
| 
 | ||
| ### Tuple, кортеж, не изменяемый список ###
 | ||
| ```python
 | ||
| price = (75, 80, 15, 41)
 | ||
| del price[0]
 | ||
| ```
 | ||
| 
 | ||
| ### Dict (словарь, ассоциативный список, похож на соответствие в 1С) ###
 | ||
| ```python
 | ||
| products = {}
 | ||
| products["стул"] = 100
 | ||
| products["стол"] = 200
 | ||
| print(products)
 | ||
| ```
 | ||
| 
 | ||
| ### Set, множества - "контейнер", содержащий не повторяющиеся элементы ###
 | ||
| ```python
 | ||
| price_1 = set([75, 80, 15, 41])
 | ||
| price_2 = {80, 2, 10}
 | ||
| price_3 = price_1 | price_2
 | ||
| price_4 = price_1 & price_2
 | ||
| print(price_3)
 | ||
| print(price_4)
 | ||
| ```
 | ||
| 
 | ||
| [Назад на главную](readme.md) |