ответ:my_basket = {}
ware_1 = input("product name - ")
my_basket[ware_1] = int(input("value - "))
ware_2 = input("product name - ")
my_basket[ware_2] = int(input("value - "))
ware_3 = input("product name - ")
my_basket[ware_3] = int(input("value - "))
ware_4 = input("product name - ")
my_basket[ware_4] = int(input("value - "))
ware_5 = input("product name - ")
my_basket[ware_5] = int(input("value - "))
print('We bought these goods:')
print('ware -', my_basket.popitem())
print("Total cost -", total_cost)
Объяснение:
ответ:my_basket = {}
ware_1 = input("product name - ")
my_basket[ware_1] = int(input("value - "))
ware_2 = input("product name - ")
my_basket[ware_2] = int(input("value - "))
ware_3 = input("product name - ")
my_basket[ware_3] = int(input("value - "))
ware_4 = input("product name - ")
my_basket[ware_4] = int(input("value - "))
ware_5 = input("product name - ")
my_basket[ware_5] = int(input("value - "))
print('We bought these goods:')
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print("Total cost -", total_cost)
Объяснение:
//c циклом for
var s,i:integer;
begin
for i:=100 to 999 do
if i mod 77 = 0 then s:=s+i;
writeln('Сумма трехзначных кратных 77: ',s);
end.
Тестовое решение:
Сумма трехзначных кратных 77: 5929
// с циклом while
var s,i:integer;
begin
i:=100;
while i<=999 do begin
if i mod 77 = 0 then s:=s+i;
i:=i+1;
end;
writeln('Сумма трехзначных кратных 77: ',s);
end.