Ask Question
3 April, 22:39

Given: a variable named incompletes that refers to a list of student ids, and a variable student_id Write some code that counts the number of times the value associated with student_id appears in the list associated with incompletes and assigns this value to number_of_incompletes. You may use, if you wish, an additional variable, k. You may use only k, incompletes, student_id, and number_of_incompletes.

+1
Answers (1)
  1. 3 April, 23:06
    0
    incompletes = [1,2,1,5,3,4,5,6,5,1,7]

    student_id = 5

    number_of_incompletes = 0

    for k in incompletes:

    if (k = = student_id):

    number_of_incompletes + = 1

    print ("Number of incompletes = ", number_of_incompletes)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Given: a variable named incompletes that refers to a list of student ids, and a variable student_id Write some code that counts the number ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers