let statuses = document.querySelectorAll('.M')
statuses.forEach((item) => {
if (item.innerText === 'Активен') {
item.classList.add('Free')
}
if (item.innerText === 'Заблокирован') {
item.classList.add('Blocked')
}
}
)
<MyStatus
class="M"
:class="{'Free': item.Status==='Активен', 'Blocked': item.Status==='Заблокирован'}"
style="width: 75%; padding: 0.25em 0.75em"
>
{{ player.Status }}
</MyStatus>
from random import randint
attempts = []
for i in range(10):
res = []
while True:
res.append(randint(0, 1))
if len(res) >= 3 and (res[-1]==res[-2]==res[-3]):
break
s = ''.join(['О' if s else 'Р' for s in res])
print(f'{s} (попыток: {len(s)})')
attempts.append(len(s))
print(f'Среднее количество попыток: {sum(attempts) / len(attempts)}.')
<div v-if="game.Winner=== game.Player1Name">тут кубок</div>
const $player1 = document.querySelector('player1')
if k == 10:
continue
async def send_random_quote(message_id):
x= quotes[randint(0,388)]
await bot.send_message(message_id, x)
scheduler.add_job(send_random_quote,'cron',day_of_week='mon-sun', hour=19,minute=6,kwargs={'message_id': callback_query.from_user.id})
app = FastAPI()
app_api = FastAPI()
app.mount("/api", app_api)
app.mount("/", StaticFiles(directory="static", html=True), name="static")
@app.get('/', response_class=HTMLResponse)
async def main_page():
return HTMLResponse('index.html')
@app_api.post('/login', response_class=JSONResponse)
async def login(
username: str = Body(...),
password: str = Body(...)
):
...
grid-template-columns: 1fr 1fr 1fr 1fr;
{'cod': '404', 'message': 'city not found'}
reader = csv.reader(open("ip.csv"))
def _sort(s):
if s.lower() == 'last checked':
return 0
res = 0
s = s.split('ago')[0].strip()
if 'hour' in s:
_s = s.split('hour')
res += int(_s[0]) * 60 * 60
s = _s[1].strip()
if 'mins' in s:
_s = s.split('mins')
res += int(_s[0]) * 60
s = _s[1].strip()
if 'min' in s:
_s = s.split('min')
res += int(_s[0]) * 60
s = _s[1].strip()
if 'secs' in s:
_s = s.split('secs')
res += int(_s[0])
return res
sort_reader = sorted(reader, key=lambda x: _sort(x[7]))
for (let i = 0; i < number; i++)