nums = input("Enter a range of numbers separated by spaces: ").split()
nums = [int(x) for x in nums]
second = nums[1]
second_last = nums[-2]
average = sum(nums) / len(nums)
print("The sum of the second, second last and average numbers is:", second + second_last + average)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
nums = input("Enter a range of numbers separated by spaces: ").split()
nums = [int(x) for x in nums]
second = nums[1]
second_last = nums[-2]
average = sum(nums) / len(nums)
print("The sum of the second, second last and average numbers is:", second + second_last + average)