You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def mystery(nums):
total = 0
for num in nums:
if num == 999:
break
else:
total += num
return total
mystery([8, 2, 999, 5, 4])
print(mystery("walking")) #why is this line here, shouldn't the previous line be: print (mystery([8, 2, 999, 5, 4]), given that the expected answer is 10.
https://runestone.academy/ns/books/published/UNDCS160-Spring2024-Python/lists/listAsArgument.html
def deleting_first(lst):
lst = lst[1:]
The slice operator creates a new list called "t", but that will not affect the list it was passed.
Activity: 9.13.4 Multiple Choice (listArg_MC_slice)
I believe the variable in the message should be lst, not t
https://runestone.academy/ns/books/published/UNDCS160-Spring2024-Python/iterations/Exercises.html
Q-16: What will the following code print?
def mystery(nums):
total = 0
for num in nums:
if num == 999:
break
else:
total += num
return total
mystery([8, 2, 999, 5, 4])
print(mystery("walking")) #why is this line here, shouldn't the previous line be: print (mystery([8, 2, 999, 5, 4]), given that the expected answer is 10.
A. 1018
B. 1009
C. 19
D. 10
https://runestone.academy/ns/books/published/UNDCS160-Spring2024-Python/iterations/mixedupcode.html
In Parsons (itr_count_last2_muc) there is an if block that is missing a colon - I know, I'm being nit-picky :-)
https://runestone.academy/ns/books/published/UNDCS160-Spring2024-Python/lists/Exercises.html
Q-15: What will the following code print?
def mystery(num_list):
out = []
for i in range(len(num_list) - 1,0,-1):
num = num_list[i]
out.append(num)
return out
print(mystery([5, 10, 15, 20]))
out.append(num) is not properly aligned
The text was updated successfully, but these errors were encountered: