mass_a = ['one', 'two', 'four']
mass_b = [1, 2, 3, 'four', 4]
if any(x in mass_b for x in mass_a):
mass_a = mass_a[:1] + mass_b + mass_a[1:]
print(mass_a)
def comfort_count(temperatures):
return len([t for t in temperatures if 22 <= t <= 26])
else:
add_item(namespace.add_value)
check_item(namespace.check_value)
else:
param, value = namespace.add_value.split(",") if namespace.add_value else [namespace.check_value, None]
add_item(param, value)
check_item(param)
create type t_varr is varray(100) of number;
create or replace function sum_varr(p_arr t_varr)
return number IS
v_res number;
begin
select sum(nvl(column_value,0)) into v_res
from table(p_arr);
return v_res;
end;
/
with t as (select 1 a, null b, null c from dual union all
select null a, null b, null c from dual union all
select null a, 2 b, 3 c from dual union all
select 5 a, 2 b, 1 c from dual)
select t.*, sum_varr(t_varr(a,b,c))
from t;
dic = {90373544:5 , 905043:4 , 444445:1 , 234235:2, 245435:5}
max_val = max(dic.values())
print([k for k,v in dic.items() if v == max_val])
for_test = round_rectangle((300, 60), 30, "#f2e8c9")
print(main_image.mode)
img_mask = for_test.convert("L").point(lambda x: min(x, 150)) # регулируем уровень прозрачности
main_image.paste(for_test, (30, 400), mask=img_mask)
for_test.putalpha(img_mask)
main_image.paste(for_test, (30, 30), mask=for_test)
search_string = 'mytext'
with open("myfile.txt") as f:
n = 0
for line in f:
n += 1
if search_string in line:
print(search_string, 'found on line', n)