Предмет: Информатика, автор: novoskroman444

Python code (40 БАЛЛОВ)
Задачи на словари и методы к ним!
2. Write a Python program to multiply all the items in a list.

4. Write a Python program to get the smallest number from a list.

6. Write a Python program to remove duplicates from a list.

8. Write a Python program to clone or copy a list.

10. Write a Python program that takes two lists and returns True if they have at least one common member.

11. Write a Python program to print a specified list after removing the 0th, 4th and 5th elements.


Baikal34: Слишком мало
Baikal34: Или я образец
Baikal34: Образец*
Baikal34: Обарзел

Ответы

Автор ответа: daniil062
0

2

list = [1, 2, 3, 4, 5]

result = 1

for i in list:

   result *= i

print(result)

4

list = [5, 2, 9, 1, 5, 8]

print(min(list))

6

list = [1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9]

result = []

for i in list:

   if i not in result:

       result.append(i)

print(result)

8

original_list = [1, 2, 3, 4, 5]

new_list = original_list.copy()

print(new_list)

10

list1 = [1, 2, 3, 4, 5]

list2 = [6, 7, 8, 9, 1]

common = False

for i in list1:

   if i in list2:

       common = True

       break

print(common)

11

list = [1, 2, 3, 4, 5, 6, 7, 8, 9]

list = [x for i, x in enumerate(list) if i not in (0, 4, 5)]

print(list)

Похожие вопросы
Предмет: Математика, автор: kudasovavaleria808