Answer:
The python program is given with appropriate comments
Explanation:
#Implementation of printStars function
def printStars(n):
#check if n is greater than 0
if n>0:
for i in range(n):
print ('*', end="")
#Declare starCount and initialize some negative integer
starCount = -8
if starCount>0:
print ('*', end="")
printStars(starCount-1)
Answer:
avg_owls=0.0
num_owls_zooA = int(input())
num_owls_zooB = int(input())
num_owls_zooC = int(input())
num_zoos = 3
avg_owls = (num_owls_zooA + num_owls_zooB + num_owls_zooC) / num_zoos
print('Average owls per zoo:', int(avg_owls))
Explanation:
There is a problem while you are trying the calculate the average owls per zoo.
As you may know, in order to calculate the average, you need to get the total number of owls in all the zoos, then divide it to the number of zoos. That is why you need to sum num_owls_zooA + num_owls_zooB + num_owls_zooC and divide the result by num_zoos
Be aware that the average is printed as integer value. That is why you need to cast the avg_owls to an int as int(avg_owls)
Answer:
As in the real world, people using a program would provide different inputs, that would require different outputs. For example in a traffic light system, there could be a function that constantly checks for if the button is pressed. When the button is pressed the traffic light loop would branch out of its current running code in order to turn the lights to red, and allow the pedestrians to cross.
Answer:
The PowerShell is a kind of shell framework, which was being developed by Microsoft for covering various administrative tasks like the configuration automation and management of certain repetitive jobs. And the term 'PowerShell' does refer to both of these- and its the shell applied for executing commands, and scripting language.
And yes, you have been infected by the virus. You need to run the antivirus immediately.
Explanation:
Please check the answer section.