Answer:
5 and 10
Explanation:
Given
The above code segment
Required
Determine the outputs
Analysing the code segment line by line
[This initialises c to 0]
c = 0
[The following iteration is repeated as long as c is less than 10]
while (c < 10):
[This increments c by 5]. Recall that c is initially 0. Hence, c becomes 0 + 5 = 5
c = c + 5
[This prints the value of c which is 5]
print(c)
The iteration is then repeated because the condition is still true i.e. 5 is less than 10
c = c + 5 = 5 + 5 = 10
[This prints the value of c which is 10]
print(c)
The iteration won't be repeated because the condition is now false i.e. 10 is not less than 10.
Hence, the output is 5 and 10.
Answer:
listNumbers = [34,56,23,56,78,89,98,45,34,33,25,26,67,78]
listString = [ ]
for i in range(14):
if listNumbers[i]%2!=0 and listNumbers[i]%5==0:
listString.append("five odd")
elif listNumbers[i]%5==0 and listNumbers[i]%2==0:
listString.append("five even")
elif listNumbers[i]%2==0:
listString.append("even")
elif listNumbers[i]%2!=0:
listString.append("odd")
print(listNumbers)
print(listString)
Explanation:
In python programming language;
- Create two lists
- The first is a list of numbers and initialize it with random values: listNumbers = [34,56,23,56,78,89,98,45,34,33,25,26,67,78]
- The second list is empty and will hold the string values listString = [ ]
- Use a for loop to iterate over all the elementts in the list of numbers
- Use the modulo operator (%) to chech for multiples of particular numbers as stipulated by the question
- Use combination of if/elif statements for each condition
- Use the .append method to add the elements into the list of strings
- finially output both lists
See attached code and output
Answer:
6
Explanation:
97+3 = 100
89+11 = 100
83+17 = 100
71+29 = 100
59+41 = 100
53+47 = 100
I counted them using excel, see pic.
I just took the test on (PF) it's C. the same
i hope this helped someone.
;-)
Answer:
in controlling the mouse or cursor
Explanation:
as is it known tha a cursor is a poniting device. and the only way to control it without a mouse is the touchpad