Original list: [1, 2, 3, 4, 5]
Updated list: [1, 2, 3, 4, 5, 6]
alist = [1, 2, 3, 4, 5]
print("Original list:", alist)
alist.insert(5, 6)
print("List after insertion:", alist)
alist.remove(1)
print(alist)
Original list: [1, 2, 3, 4, 5]
List after insertion: [1, 2, 3, 4, 5, 6]
[2, 3, 4, 5, 6]
nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
even_sum = 0
for num in nums:
if num % 2 == 0:
even_sum += num
min_value = min(nums)
max_value = max(nums)
print("Sum of even numbers in the list:", even_sum)
print("Minimum value in the list:", min_value)
print("Maximum value in the list:", max_value)
Sum of even numbers in the list: 30
Minimum value in the list: 1
Maximum value in the list: 10