Answer:
The Register stores data temporarily for the Arithmetic and Logic Unit ALU and give to output device.
Answer:
Posttest
Explanation:
A loop in programming is the continuous execution of a specific task to a determined number of times with a given condition. It is a written line or lines of code that is logical coded to repeat execution for multiple but fixed number of time. There are majorly two types of loops in programming, they are,
1. Posttest loop statement.
2. Pretest loop statement.
The posttest loop statement is written to execute lines of code at least once, following a condition, for which it evaluates the condition after the code is executed.
The pretest loop statement also execute the code with a condition, but evaluates the condition before the code is executed.
The balloons will repel each other because they have similar changes
They tell them how it can improve and become better and also helps fix bugs and give people the best experience <span />
Answer:
The code with explanatory comments are given in Python below
Explanation:
#2.22
s = "Lionel Pogba" #string s with names having LP as initials
names = s.split() #splits the string into individual characters
initial = "" #we are initialising the initials as an empty string
for i in names:
initial += i[0] #making the initials of the string
print(initial)
#2.23
l = [3, 7, -2, 12]
range = (max(l) - min(l)) #declare and initialise variable range for the range
print(range) #output of the range
#2.24
l1 = [3, 7, 17, -2, 12]
#(a)
midIndex = int(len(l1)/2) #evaluates half the length of the list
#which corresponds to the middle index of the list
print(midIndex)
#(b)
print(l1[midIndex]) #assigns the value of the middle index of the list
#corresponding to the middle element
#(c)
l1.sort(reverse=True) #reverses the elements of the list to descending order
print(l1)
#(d)
firstValue = l1[0] #firstValue variable representing the first element
l1 = l1[1:] + [firstValue] #assigning the location to the last position
print(l1)