data = '''[auth][22.03 11:33:40] help
[auth][22.03 11:33:42] i'am admin
[auth][22.03 11:34:00] proceed command
[auth][22.03 11:34:04] Replied to question
[auth][22.03 11:34:05] txt
[auth][22.03 11:34:26] txt
[auth][22.03 11:34:26] Aboba
[auth][22.03 11:34:29] Replied to question
[auth][22.03 11:34:37] text'''
requested_string = 'Replied to question'
[print(line) for line in data.splitlines() if requested_string in line]
print('hello' in 'hello world')
python3 setup.py install
Кто подскажет, где моя ошибка?
import sqlite3
sql = sqlite3.Connection('enter.db')
c = sql.cursor()
print('Подключение к базе данных проведено успешно!')
c.execute("""CREATE TABLE IF NOT EXISTS users (userlogin TEXT, password INTEGER, cash INTEGER)""")
sql.commit()
userlogin = input('Логин: ')
password = input('Пароль: ')
c.execute("SELECT userlogin FROM users where (?)", (userlogin,))
if c.fetchone() is None:
c.execute('INSERT INTO users VALUES (?, ?, ?)', (userlogin, password, 0))
sql.commit()
else:
print('Такой логин уже занят')
c.execute("SELECT * FROM users")
print(c.fetchall())
def fb(i: int, number_: int, fb_dict_: list) -> str:
"""
:param i:
:param number_:
:param fb_dict_:
:return:
"""
return str(fb_dict_[i % number_][number_])
def fb_calc(size: int, _numbers: tuple, _fb_dict: list):
"""
:param size:
:param _numbers:
:param _fb_dict:
"""
a, b = _numbers
for i in range(size):
print(''.join({fb(i, a, _fb_dict), fb(i, b, _fb_dict)}) or i)
if __name__ == '__main__':
numbers = (3, 13)
fb_size = 1000000
non_fb = {numbers[0]: '', numbers[1]: ''}
fb_dict = [{numbers[0]: 'fizz', numbers[1]: 'buzz'}]
for j in range(max(numbers)):
fb_dict.append(non_fb)
fb_calc(fb_size, numbers, fb_dict)
print(''.join({fb(i, a, _fb_dict), fb(i, b, _fb_dict)}) or i)
author = ctx.message.author
правильное обращение к искомому объекту? .author - это случайно не метод, который вы вызываете как параметр? Проверьте тип возвращаемого объекта, точно ли строка?