SELECT * FROM table
WHERE DATEPART(hour, [date_field]) > 9
l_1 = 3
l_2 = 4
l_3 = 5
hits = 0
guesses = 0
isSunk = False
while isSunk == False:
guess = int(input("На старт, внимание, огонь!(введите любое число от 0 до 6):"))
if guess < 0 or guess > 6:
print("Пожалуйста, введите коректную цифру")
else:
guesses += 1
if guess == l_1 or guess == l_2 or guess == l_3:
print("Попал!")
hits += 1
if hits == 3:
isSunk = True
print("Ты только что, потопил мой корабль!")
else:
print("Мимо!")
var data = [
{id: 1, name: 'Категория 0-1', parent: 0},
{id: 2, name: 'Категория 0-2', parent: 0},
{id: 3, name: 'Категория 0-3', parent: 0},
{id: 4, name: 'Категория 1-1', parent: 1},
{id: 5, name: 'Категория 1-2', parent: 1},
];
var getChilds = (data,par)=>data.filter((el)=>el.parent == par).map(el=>{el["childs"]=getChilds(data,el.id);return el;});
var tree = getChilds(data,0)
[
{
"id": 1,
"name": "Категория 0-1",
"parent": 0,
"childs": [
{
"id": 4,
"name": "Категория 1-1",
"parent": 1,
"childs": []
},
{
"id": 5,
"name": "Категория 1-2",
"parent": 1,
"childs": []
}
]
},
{
"id": 2,
"name": "Категория 0-2",
"parent": 0,
"childs": []
},
{
"id": 3,
"name": "Категория 0-3",
"parent": 0,
"childs": []
}
]
import json
data = json.loads("""[{'slot': -1, 'team': 2, 'time': 576.41, 'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'slot': -1, 'team': 2, 'time': 791.491, 'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 129,
'slot': 6,
'team': 3,
'time': 1187.728,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 4,
'slot': 4,
'team': 2,
'time': 1237.115,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 129,
'slot': 6,
'team': 3,
'time': 1366.95,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'slot': -1, 'team': 2, 'time': 1621.088, 'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 130,
'slot': 7,
'team': 3,
'time': 1655.347,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 132,
'slot': 9,
'team': 3,
'time': 1686.872,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 2,
'slot': 2,
'team': 2,
'time': 1751.123,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 4,
'slot': 4,
'team': 2,
'time': 1780.849,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'slot': -1, 'team': 3, 'time': 1927.636, 'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 129,
'slot': 6,
'team': 3,
'time': 2117.449,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'player_slot': 132,
'slot': 9,
'team': 3,
'time': 2156.047,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'key': '512', 'time': 2178.992, 'type': 'CHAT_MESSAGE_BARRACKS_KILL'},
{'player_slot': 4,
'slot': 4,
'team': 2,
'time': 2326.829,
'type': 'CHAT_MESSAGE_TOWER_KILL'},
{'key': '2', 'time': 2333.384, 'type': 'CHAT_MESSAGE_BARRACKS_KILL'}]""".replace("'",'"'))
for i,e in enumerate(data):
if e['type'] == 'CHAT_MESSAGE_BARRACKS_KILL':
print(data[i-1])