Question
plz answers these short Qs in python language Q1-You are given a variable zipcode_list that refers to a list. Write some code that assigns True
plz answers these short Qs in python language
Q1-You are given a variable zipcode_list that refers to a list.
Write some code that assigns True to a variable duplicates if there are two adjacent elements in the list that have the same value, but that otherwise assigns False to duplicates otherwise. In order to accomplish this, you may, if you wish, use one other variable, k.
Use only k, zipcode_list, and duplicates.
Q2-Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data, compute the average temperature and assign it to a variable named avg_temp. Besides temps and avg_temp, you may use two other variables -- k and total.
Q3-
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.
Q4-Given that a refers to a list, write the necessary code to reverse the elements of the list.
.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started