Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help python 3.0 1. Given: a variable named incompletes that refers to a list of student ids, and a variable student_id Write some code that

Help python 3.0

1.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.

2.Associate the sum of the non-negative values in the list numbers with the variable sum.

3.Given the lists list1 and list2 that are of the same length, create a new list consisting of the last element of list1 followed by the last element of list2, followed by the second to last element of list1, followed by the second to last element of list2, and so on (in other words the new list should consist of alternating elements of the reverse of list1 and list2). For example, if list1 contained [1, 2, 3] and list2 contained [4, 5, 6], then the new list should contain [3, 6, 2, 5, 1, 4]. Associate the new list with the variable list3.

 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

Students also viewed these Databases questions

Question

What roles have these individuals played in your life?

Answered: 1 week ago