ダ
Size: a a a
ダ
ダ
repl1 = telebot.types.InlineKeyboardMarkup()
a = ["name1", "name2", "name3", "name4", "name5"]
for i,k in zip(a[0::2], a[1::2]):
button1 = telebot.types.InlineKeyboardButton(text=str(i), callback_data=str(i))
button2 = telebot.types.InlineKeyboardButton(text=str(k), callback_data=str(k))
repl1.add(button1, button2)
a.remove(str(i)); a.remove(str(k))
if a:
button1 = telebot.types.InlineKeyboardButton(text=str(a[0]), callback_data=str(a[0]))
repl1.add(button1)
ダ
🚀
repl1 = telebot.types.InlineKeyboardMarkup()
a = ["name1", "name2", "name3", "name4", "name5"]
for i,k in zip(a[0::2], a[1::2]):
button1 = telebot.types.InlineKeyboardButton(text=str(i), callback_data=str(i))
button2 = telebot.types.InlineKeyboardButton(text=str(k), callback_data=str(k))
repl1.add(button1, button2)
a.remove(str(i)); a.remove(str(k))
if a:
button1 = telebot.types.InlineKeyboardButton(text=str(a[0]), callback_data=str(a[0]))
repl1.add(button1)
T
S
🚀
S
repl1 = telebot.types.InlineKeyboardMarkup()
a = ["name1", "name2", "name3", "name4", "name5"]
for i,k in zip(a[0::2], a[1::2]):
button1 = telebot.types.InlineKeyboardButton(text=str(i), callback_data=str(i))
button2 = telebot.types.InlineKeyboardButton(text=str(k), callback_data=str(k))
repl1.add(button1, button2)
a.remove(str(i)); a.remove(str(k))
if a:
button1 = telebot.types.InlineKeyboardButton(text=str(a[0]), callback_data=str(a[0]))
repl1.add(button1)
ダ
T
🚀
S
py3
l=[1,2,3,4,5]
a = zip(l[0::2])
print(a)
<zip object at 0x7fda444660c8>
ダ
S
🚀
S
py3
l=[1,2,3,4,5]
a = zip(l[0::2])
print(a)
<zip object at 0x7fda444660c8>
ダ
S
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__']