Answer: I think it's D.
Explanation: I'm sorry if I chose the wrong answer, I'm not too good with stuff like this.
Answer:
<h2>it is a random error </h2>
Explanation:
<h3>I HOPE THAT THIS ANSWER HELPS YOU </h3>
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 program to this question can be described as follows:
Program:
#include <iostream> //defining header file
using namespace std;
int main() //defining main method
{
int x; //defining integer variable
for(x=0;x<=100;x++) //defining loop to count value from 0 to 100
{
if(x%7==0) //check value is divisable by 7
{
cout<<x<<endl; //print value
}
}
return 0;
}
Output:
please find the attachment.
Explanation:
In the above code, an integer variable x is declared, which is used in the for loop, in this loop variable "x" starts from 0 and ends when the value of x is less than and equal to 100.
- Inside the loop an, if block is used that defines a condition that is (i%7==0), it will check, that the value is divided by 7.
- In this loop, a print method is used, that prints its values.