Answer:
The solution code is written in Python 3:
- def modifyList(listNumber):
- posCount = 0
- negCount = 0
-
- for x in listNumber:
- if x > 0:
- posCount += 1
- else:
- negCount += 1
-
- if(posCount == len(listNumber)):
- listNumber.append(max(listNumber))
-
- if(negCount == len(listNumber)):
- listNumber.append(min(listNumber))
-
- print(listNumber)
-
- modifyList([-1,-99,-81])
- modifyList([1,99,8])
- modifyList([-1,99,-81])
Explanation:
The key step to solve this problem is to define two variables, posCount and negCount, to track the number of positive value and negative value from the input list (Line 2 - 3).
To track the posCount and negCount, we can traverse through the for-loop and create if else statement to check if the current number x is bigger than 0 then increment posCount by 1 otherwise increment negCount (Line 5- 9).
If all number in the list are positive, the posCount should be equal to the length of the input list and the same rule is applied to negCount. If one of them happens, the listNumber will append either the maximum number (Line 11 -12) or append the minimum number (Line 14-15).
If both posCount and negCount are not equal to the list length, the block of code Line 11 -15 will be skipped.
At last we can print the listNumber (Line 17).
If we test our function using the three sets of input list, we shall get the following results:
[-1, -99, -81, -99]
[1, 99, 8, 99]
[-1, 99, -81]
Answer:
C. &&
Explanation:
Of the options provided:
A) ++ : increment operator. For example : ++1 = 2
B) || : Logical OR operator. A || B is true if any one of A or B is true.
C) && : Logical AND operator. A && B is true if both A and B are true.
A B A && B
False False False
False True False
True False False
True True True
D) @ : Ampersand character (commonly used in email addresses) e.g, [email protected]
<span>Go paperless.
Use natural lighting.
Grow trees nearby.
Reduce, reuse, and recycle.
Carpool.
</span>
Tech a says that a direct tpms system uses a pressure sensor located in each wheel. This is a TRUE statement.
Explanation:
- A tire-pressure monitoring system (TPMS) is an electronic system designed to monitor the air pressure inside the pneumatic tires on various types of vehicles. A TPMS reports real-time tire-pressure information to the driver of the vehicle, either via a gauge, a pictogram display, or a simple low-pressure warning light.
- Direct TPMS uses a sensor mounted in the wheel to measure air pressure in each tire. When air pressure drops 25% below the manufacturer's recommended level, the sensor transmits that information to your car's computer system and triggers your dashboard indicator light.
- Mounted inside a tire assembly on valve stems or wheel rims, the sensors are usually powered by 3-volt lithium ion batteries, but some use 1.25-volt nickel metal hydride batteries. There are developments underway that promise battery-less sensors in the future, having the potential to dramatically change TPMS markets
- The tire pressure monitor system that uses a valve-stem-type transmitter is the direct reading type of TPMS.
Answer:
Internet
Explanation:
just took the test and got A