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:
1. =CONCATENATE(" John"," ","Smith")
2. =(" John"&" "&"Smith")
Explanation:
Given
Two separate strings; "John" and "Smith"
Required
2 separate formulas to concatenate both strings to form " John Smith"
There are several ways to concatenate strings in Microsoft Office Excel; one of the methods is using the concatenate function while the another method is using the traditional & operator.
Using the concatenate function, the formula is as follows
=CONCATENATE(" John"," ","Smith")
This function will combine the " John", " " and "Smith" to give a new string " John Smith" (without the quotes).
Using the traditional & operator may be a little bit difficult (and not frequently used) but the formula is as follows;
=(" John"&" "&"Smith")
The result will be the same as (1) above
The bullets button is available on the home tab of the ribbon in the ____ group.
Paragraph
Answer:
Yes, the relation is a function
Domain = {-3,1,3,7}
Range = {7,3,1-1}
Explanation:
Given
{(-3,7),(1,3),(3,1),(7,-1)}
To determine if the relation is a function or not, we check if every output has only one corresponding input.
The output are (7,3,1-1) while the input are (-3,1,3,7)
-3 ----;> 7
1 -------> 3
3 -------> 1
7 -------> -1
It is a function since every output only has one corresponding input
To find the domain, we look at the set of input values
Domain = {-3,1,3,7}
To find the range, we look at the set of output values
Range = {7,3,1-1}