ダ
Size: a a a
ダ
ダ
S
T
ダ
x = 0
y = 1
for i in ProductName:
try:
productkb.row(ProductName[x][0], ProductName[y][0])
except:
try:
productkb.row(ProductName[x][0])
except:
break
x = x + 2
y = y + 2
ダ
repl1 = telebot.types.InlineKeyboardMarkup()
a = ["name1", "name2", "name3", "name4", "name5"]
for i in range(math.ceil(len(a)/2)):
if len(a) > 1:
button1 = telebot.types.InlineKeyboardButton(text=a[0], callback_data=a[0])
button2 = telebot.types.InlineKeyboardButton(text=a[1], callback_data=a[1])
repl1.add(button1, button2)
del a[0]
del a[0]
elif len(a) == 1:
button1 = telebot.types.InlineKeyboardButton(text=a[0], callback_data=a[0])
repl1.add(button1)
del a[0]
ダ
ダ
S
ダ
S
🚀
🚀
S
repl1 = telebot.types.InlineKeyboardMarkup()
a = ["name1", "name2", "name3", "name4", "name5"]
for i in range(math.ceil(len(a)/2)):
if len(a) > 1:
button1 = telebot.types.InlineKeyboardButton(text=a[0], callback_data=a[0])
button2 = telebot.types.InlineKeyboardButton(text=a[1], callback_data=a[1])
repl1.add(button1, button2)
del a[0]
del a[0]
elif len(a) == 1:
button1 = telebot.types.InlineKeyboardButton(text=a[0], callback_data=a[0])
repl1.add(button1)
del a[0]
S
T
B
py3
l=[1,2,3,4,5]
a = zip(l[0::2])
print(dir(a))
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
py3
l=[1,2,3,4,5]
print(l[0::2])
[1, 3, 5]
ダ
py3
l=[1,2,3,4,5]
print(l[0::2])
[1, 3, 5]
B
py3
l="тест текста"
print(l[0::2])
тс еса