Answer:
No
because spreadsheet is used for calculation not for writing address
Drag... you drag the mouse across the screen.
Answer:
nums = []
while True:
in = input()
if in:
nums.append(in)
else:
break
if nums:
avg = sum(nums) / len(nums)
for i in range(len(nums)):
if nums[i] == avg:
print(f"index: {i+1}")
print(nums[i])
else:
print(-1) # if there aren't any values in nums
Explanation:
Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.
Answer: 1 time.
Explanation:
- A binary function is also known as a half-interval search is a search algorithm to find the position of a given element x within a well-sorted array [].
- Binary search compares the target value to the middle element of the array.
- It ignores half of the elements just after one comparison.
- it compares x with the middle element.
So, the function read an element <u>one time</u> in the array before finding the value.