goods_dict = [
{'id': '1', 'goods': 'macbook 16 pro', 'brand': 'Apple'},
{'id': '2', 'goods': 'ThinkPad X1 Extreme Gen 3', 'brand': 'lenovo'},
{'id': '3', 'goods': 'XPS 17 9710 Silver', 'brand': 'Dell'}
]
#лист акссесуаров
add_lists = [
['Apple','стилус'],
['lenovo','коврик'],
['hp','мышь'],
['asus','флешка']
]
for item in add_lists:
item_brand = item[0]
item_name = item[1]
print(item_brand)
print('-',item_name)
for good in goods_dict:
good_brand = good['brand']
print('--',good_brand)
if not good.get('accessory'):
if good_brand == item_brand:
good['accessory'] = item_name
else:
good['accessory'] = None
for good in goods_dict:
print(good)
sqlite3.IntegrityError: UNIQUE constraint failed: test.us_id.
sqlite3.IntegrityError: условие "УНИКАЛЬНОЕ значение" не соблюдено: test.us_id.
some_dict = {}
some_dict["letter"] = db_row[0] # db_row - кортеж
...
return some_dict
some_dict = {}
... # do cycle
some_dict[cha_index] = cha[cha_index] # cha_index - индекс значения в списке.
Или отправьте на фриланс где не дорого за задачу возьмут. на кворке желающих не нашлось (
urlpatterns = [
path('<int:cocktail_id>/', by_cocktail_id),
path('<str:cocktail_name>/', by_cocktail_name),
path('', index),
]
имя%20коктейля
call.message.text
не может быть преобразовано в число.def generator():
pass
gen = generator()
gen = (s(k)/4 for k in range(10)):
print(next(gen))
с отступом.def generator():
pass
gen = generator()
for _ in range(10):
print(next(gen))
IndentationError: expected an indented block after 'while' statement on line 11
IndentationError: ожидался блок с отступом после оператора while в строке 11
['1212\n', '12323\n', '3434']
# db.txt
1212
12323
3434
# main.py
with open ('db.txt', 'r', encoding='UTF-8') as file:
lines = file.readlines()
if str(3434) in lines:
print('ok')
else:
print(lines)
LIMIT 30
в sqlя не понимаю как работать с кортежами в кортеже