• Предмет: Информатика
  • Автор: dkostina484
  • Вопрос задан 5 месяцев назад

ПОЖАЛУЙСТА, СРОЧНО!!!!!!! ДАЮ 90 БАЛЛОВ

Приложения:

ap319487: Как я могу это сделать, не учась в твоем классе?
dkostina484: обычные имена, потрм
dkostina484: Потом можно просто заменить их
ap319487: какой язык программирования?
dkostina484: IDLE Python
ap319487: готово

Ответы

Ответ дал: ap319487
2

# 1. Create an array of class student names

class_names = ["John", "Mike", "Sara", "Jessica", "David", "Emily"]

# 2. Print the entire array

print(class_names)

# 3. Print the name of the last student

print(class_names[-1])

# 4. Print the name of the 5th student

print(class_names[4])

# 5. Sort the array alphabetically and print the result

class_names.sort()

print(class_names)

# 7. Add "Ermek" to the end of the array and print the list

class_names.append("Ermek")

print(class_names)

# 8. Remove "Ermek" from the array

class_names.remove("Ermek")

# 9. Add "Marina" to the beginning of the list

class_names.insert(0, "Marina")

# 10. Print all even-indexed elements of the array

for i in range(0, len(class_names), 2):

   print(class_names[i])

Вас заинтересует