Question | Click to View Answer |
What does the following print to the console. sum = 0
counter = 0
numbers = [1, 2, 3, 4]
while counter < len(numbers):
sum = sum + numbers[counter]
counter = counter + 1
print(sum)
|
The |
What does the following print to the console. word = ""
counter = 0
letters = ["c", "a", "r"]
while counter < len(letters):
word = word + letters[counter]
counter = counter + 1
print(word)
|
The |
What does the following print to the console. sum = 0
counter = 0
numbers = [22, 55, 111, 555]
while numbers[counter] < 100:
sum = sum + numbers[counter]
counter = counter + 1
print(sum)
|
This |
What does the following print to the console. result = 0
numbers = [2, 4, 6]
for num in numbers:
result = result + num
print(result)
|
The
|
What does the following print to the console. word = ""
letters = ["t", "r", "a", "i", "n"]
for letter in letters:
word = word + letter
print(word)
|
The |