Answer:
sqsum4
Explanation:
So to raise a number to a power in python, you can use the ** operation, which is usually confused with the ^, which is an operation, but it is not for raising numbers to a power. It is the xor bit operation, which if you don't know at the moment, it's fine, since it's not necessary for this. each of these lists uses a generation comprehension which is generally defined as: (x for x in object if condition) with the if condition being optional, but in this case it's necessary. If it's a bit confusing, you can define a generator using a function so it's a bit more spread out:
def generator(object):
for x in object:
if condition:
yield x
Although in this instance were going to be performing some operation on x, which in this case is squaring it. So let's just look at the two functions that use the **, since they should be the only options that will be correct.
sqsum1(nums):
This function does square x, except it uses incorrect syntax. The condition should come after the for loop. Python likely wont tell you this, because it may think you're trying to do something else. You can do one line if statements like this: a if condition else b, which will return a if the condition is true, and b if it isn't. So it may think that you're trying to do this one line if statement, and say that you're missing an else. The function could even implement in this way: <em>x**2 if x > 0 else 0 for x in nums</em>. This way if the x is negative it counts as 0, or in other words isn't counted towards the sum. But without this fix, the function will raise a syntax error
sqsum4(nums):
This will square each number in x only if the current element "x" is greater than 0, or in other words positive. And then it returns the sum. So this function returns the expected output
Answer:
suppose i was i would tell them i dont know and walk away
Explanation:
in thoery this is correct
you said suppose so i answerd
there is no use in reporting or getting this taken down
nether is it right
im not stealing points
Because in thoery its an answer
<em><u>THIS IS MY PROTEST</u></em>
Answer:
The correct answer to the following question will be "Option A".
Explanation:
Data validation seems to be an important part of every data managing mission unless you are in that area of information or data collection, data processing or planning to deliver the information to stakeholders.
- Validation could be viewed as something of an integral component of your process instead of as a further move.
- If your data set isn't correct from the beginning, then your outcomes will undoubtedly not be correct either. That's why the data needs to be checked or tested until it becomes used.
The other three options are not related to the given topic. So Option A is the right answer.
Answer: C
it would broaden the search
Explanation:
Placing quotation marks around a search term or phrase limits your search to that exact term or phrase. Without the quotes, your search engine may return all results that contain each separate word. Placing AND between your keywords will return results that only include both or all your keywords.
Answer:
A dictionary is a "key - value" pair data structure type. The syntax for creating a dictionary requires that the keys come first, before the values.
This problem in the question above is as a result of you interchanging the keys and values. THE KEYS MUST COME FIRST BEFORE THE VALUES
Explanation:
To solve this problem you will need to rearrange the code this way
points_to_names = {"home":[0, 0] , "school":[1, 2], "market":[-1, 1] }
See the attached code output that displays the dictionary's keys and values