finished_sandwiches = [dish for dish in sandwich_orders if dish != 'pastrami']
print(finished_sandwiches )
In [1]:
['bokaldilo', 'arepa', 'kebab']
while 'pastrami' in sandwich_orders:
sandwich_orders.pop(sandwich_orders.index('pastrami'))
print(sandwich_orders)
In [2]:
['bokaldilo', 'arepa', 'kebab']
<div>
<img src="" alt="">
<p>Что то там</p>
</div>
div{
position: relative;
}
p{
position:absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
}
def buble(array):
replaced = True
for _ in array:
#Если замен не было - выходим из цикла
if not replaced: break
replaced = False
#Проходимся по списку и сравниваем 2 элемента
for el in range(len(array)-1):
#Если текущий элемент больше следующего
if array[el] > array[el+1]:
#Меняем местами
array[el], array[el+1] = array[el+1], array[el]
#ставим "флаг" что произошла замена
replaced = True
return array
array = [6,7,8,9,5,3,2,1,4,0]
print(buble(array))
a, b = int(input()), int(input())
if a > b:
print('>')
elif a < b:
print('<')
elif a == b:
print('=')
#Переработанный ваш
fin_name = 'input.txt'
fout_name = "output.txt"
with open(fin_name) as fin:
a, b = map(lambda x: int(x.strip()), fin.readlines())
result = None
if a > b:
result = '>'
elif a < b:
result = '<'
elif a == b:
result = '='
with open(fout_name, 'w') as fout:
fout.write(result)