if check.find(name) != -1:
bot.send_message(message.chat.id, articlerbc.a['href'] + f' Связанная новость с {name}',reply_markup=key_user)
elif check2.find(name) != -1:
bot.send_message(message.chat.id, articlerbc.a['href'] + f' Связанная новость с {name}',reply_markup=key_user)
if name in check or name in check2:
bot.send_message(message.chat.id, articlerbc.a['href'] + f' Связанная новость с {name}',reply_markup=key_user)
test = list('python test')
num = 0
string = ''
while num < len(test):
string = string + test[num]
num += 1
print(test, '\n', string)
test = list('python test')
string = ''
for element in test:
string = ''.join([string, element])
print(test, '\n', string)
string = ''.join(test)
print(test, '\n', string)
print(test, '\n ', *test, sep='')
def get_input(number):
return input(f'Введите {number} натуральное число:')
def get_int(number=None):
if not number:
number = ''
result = get_input(number)
while not result.isdigit():
print('Ошибка.')
result = get_input(number)
return int(result)
def get_2_ints():
first = get_int('первое')
second = get_int('второе')
return first, second
my_ints = get_2_ints()
print(my_ints)
my_first_int, my_second_int = my_ints
print(my_first_int * 2)
print(my_second_int * 3)