Answer:
Explanation:
The following code is written in Python and creates a function called create_sentence which takes in 2 parameters which are the number of spaces and the number of stars. Then it uses these values to create the sentence and return it.
def create_sentence(spaces, stars):
sentence = ""
for x in range(spaces):
sentence += " "
for x in range(stars):
sentence += "★"
sentence += "\n"
return sentence
hello there
the answer is
Automated Fingerprint Verification
thank you
Answer:
1. Option A: for loop is correct
2. Option B: while loop is correct
Explanation:
Two loops are used commonly. For and while
For is used when the number of iterations are already known and while is used when number of iterations is not known and the loop has to be terminated based on any condition.
<u>1. You are finding the batting average of 13 baseball players.
</u>
For loop will be used as the number of iterations is already known. The score of 13 players has to be used to calculate the average so there will be 13 iterations. Hence, for loop will be used.
<u>2. You are asking your users for the names of all the stores where they shopped to find their friend's birthday present. They will show they are done by entering the word "done."</u>
While loop will be used as the termination of loop depends on the input given by the user so the number of iterations are not already known.
Hence,
1. Option A: for loop is correct
2. Option B: while loop is correct
Answer:
local scope which is the entire body of the function/method that it is being used in
Explanation:
The variable numC has a local scope which is the entire body of the function/method that it is being used in, which in this scenario is the passwordMaker method. This is because the variable numC is being used as a parameter variable for that method, meaning that a piece of information is being inputted by when the method is called and saved as the variable numC which is then used by the lines of code inside the method, but cannot be accessed from outside the method thus.