Answer:
def typeHistogram(it,n):
d = dict()
for i in it:
n -=1
if n>=0:
if str(type(i).__name__) not in d.keys():
d.setdefault(type(i).__name__,1)
else:
d[str(type(i).__name__)] += 1
else:
break
return list(d.items())
it = iter([1,2,'a','b','c',4,5])
print(typeHistogram(it,7))
Explanation:
- Create a typeHistogram function that has 2 parameters namely "it" and "n" where "it" is an iterator used to represent a sequence of values of different types while "n" is the total number of elements in the sequence.
- Initialize an empty dictionary and loop through the iterator "it".
- Check if n is greater than 0 and current string is not present in the dictionary, then set default type as 1 otherwise increment by 1.
- At the end return the list of items.
- Finally initialize the iterator and display the histogram by calling the typeHistogram.
Answer:
The correct answer to the following question is option b.)sends messages involving products of companies previously sued under the CAN-SPAM Act.
Explanation:
This act is an act of Controlling the Assault of Non-Solicited Marketing And Other things.
It is the law that establish the rules for the commercial message and the commercial e-mails, gives recipients right to have the business stops emailing them, and they outline the penalties incurred for those person who has violated the law.
Answer:
a) Speedup gain is 1.428 times.
b) Speedup gain is 1.81 times.
Explanation:
in order to calculate the speedup again of an application that has a 60 percent parallel component using Anklahls Law is speedup which state that:
Where S is the portion of the application that must be performed serially, and N is the number of processing cores.
(a) For N = 2 processing cores, and a 60%, then S = 40% or 0.4
Thus, the speedup is:
Speedup gain is 1.428 times.
(b) For N = 4 processing cores and a 60%, then S = 40% or 0.4
Thus, the speedup is:
Speedup gain is 1.81 times.
The odd values in a list can be calculated by knowing the first and last number, whereas even numbers can be divided by two and the remainder is zero (0).
<h3>What are even numbers and odd numbers?</h3>
The even numbers can be found in a list because they are divisible by two and the remainder of this equation is always zero (0).
Conversely, odd numbers are those that cannot be divided exactly into exact entire numbers (e.g., 3, 5, etc).
The odd numbers in a list can be calculated by the equation ON (odd numbers): n/2 × [f + g], where 'f' is the first number and 'g' is the last number.
In conclusion, the odd values in a list can be calculated by knowing the first and last number, whereas even numbers can be divided by two and the remainder is 0.
Learn more about odd numbers here:
brainly.com/question/2263958
#SPJ1
Answer:
Explanation:
The computation of the velocity by using the following formula is
As we know that
where,
Displacement is 10 meters
Total time taken is 30 seconds
Now placing these values to the above formula
So, the velocity of Dash is
We simply applied the above formula so that we can get the velocity and the same is to be considered