Common input devices include the keyboard, image scanner, and integrated video cameras. These also include the microphone, mouse, joystick controller, gamepad or joypad, webcam, digital pen, and others. Input devices are computer hardware used to control signals and provide data to a computer or an information appliance.
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:
6 2 and 0
Explanation:
This algorithm doesn't work if the list is not ordered ascending.
In this example it is not, and indeed the item "1" is never found.
first cycle: first=0, last=12 so midpoint=6
second cycle: first=0, last=5 so midpoint=2
last cycle: first=0, last=1 so midpoint=0
then last is assigned -1 so the while statement is no longer true.
<em>The answer is: your GPS unit cannot send signals to the satellite when it cannot reach it by line of sight.
</em>
<em>
</em>
<em>GPS signals are based on frequencies that can be blocked by solid objects (like walls and roofs). A GPS device is using a series of satellites to detect and see where it is physically located. These frequencies are sent from these plates (satellites) and we cannot expect it to go through all kinds of barriers. When you use a GPS inside a building, a wide variety of physical barriers and potential interference sources make it difficult for the device to detect your location accurately.
</em>
<em>
</em>
<em />