SlideShare a Scribd company logo
CS10 Python Programming Homework 4
40 points
Lists, Tuples, Sets, and Files
1. You must turn in your program listing and output for each
program set. Start a new sheet or sheets of paper
for each program set. Each program set must have your student
name, student ID, and program set
number/description. All the program sets must be printed and
submitted together with your Exam 4. Once
you complete your Exam 4 and leave the classroom you will not
be able to submit Homework 4. Late
homework will not be accepted for whatever reasons you may
have.
*****************************************************
*****************************************************
**********************
for this homework, you are also to submit All Program Sets to
Canvas under Homework 4 link
*****************************************************
*****************************************************
**********************
a. Name your file : PS1_firstinitial_lastname.py for Program Set
1. PS means program set
b. You still have to submit the paper copy together with the rest
of the Homework 4.
c. You have till 11:59pm the night before the day of Exam 4 to
submit all Program Sets to Canvas.
If the deadline is past, Program Sets will not be graded even if
you submit the paper copy on
time.
d. You must submit both hardcopy and upload the Program Sets
to Canvas to be graded. If you
only submit the hardcopy or only upload to Canvas you will
receive a zero for the Program Sets.
You must submit all the hardcopies of all Program Sets of
Homework 4.
e. if you do not follow instructions on file naming provided in
this section you will receive a zero for
the whole of Homework 4.
2. You must STAPLE (not stapled assignments will not be
graded resulting in a zero score) your programming
assignment and collate them accordingly. Example Program set
1 listing and then output, followed by
Program Set 2 listing and output and so on.
3. Please format you output properly, for example all dollar
amounts should be printed with 2 decimal places.
Make sure that your output values are correct (check the
calculations).
4. Each student is expected to do their own work. IF
IDENTICAL PROGRAMS ARE SUBMITTED, EACH
IDENTICAL PROGRAM WILL RECEIVE A SCORE OF ZERO.
Grading:
Each program set must run correctly syntactically, logically,
and display the correct output as specified. If
the program set does not run correctly, a zero will be given. For
each Program set, if the program executes
properly with proper syntax, logic, and displays the correct
output, then points will be deducted for not having
proper:
a. Comments (1 pt deducted for each occurrence)
- Your name, description at the beginning of each program set.
Short description of the what
each section of your codes do.
b. Consistency/Readability (2 pts deducted for each occurrence)
- Spacing(separate each section of codes with a blank line
- Indentation
- Style (proper naming of variables no a,b,c – use descriptive
and mnemonics)
-each function must include type hints or annotations except for
the main()
-include docstrings for every function
c. Required elements (2 pts deducted for each occurrence)
- Use tools that have been covered in class
- proper formatting for output when specified
- all monetary values must be in 2 decimal places
d. Output
file, a zero will be given for
that program set.
to be displayed at the end of the program
listing(codes)
question. Provide your own test
cases if the program set does not ask for any. The minimum
test cases you provide on
your own is 5 or more. If you provide less then 5 test cases per
Program Set then that
program set will receive a zero grade.
Program Set 1 (40 points)
Write list functions for items a to j that carry out the following
tasks for a list of integers.
a. Swap the first and last elements in the list.
b. Shift all elements by one to the right and move the last
element into the first position.
For example, 1 4 9 16 25 would be transformed into 25 1 4 9 16.
c. Replace all even elements with 0 (zeroes)
d. Replace each element except the first and last by the larger of
its two neighbors.
e. Remove the middle element if the list length is odd, or the
middle two elements if the length is even.
f. Move all even element to the front, otherwise preserving the
order of the elements.
g. Return the second largest element in the list.
h. Return true if the list is currently sorted in increasing order.
i. Return true if the list contains two adjacent duplicate
elements.
j. Return true if the list contains duplicate elements (which need
not be adjacent).
The main() function to test each of the functions is included
here for you. You must use the same function names
that is provide for you below. Using other function names will
result in a zero for this program.
# Program to test functions a to j.
#
# Define constant variables.
ONE_TEN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def main() :
print("The original data for all functions is: ", ONE_TEN)
#a. Demonstrate swapping the first and last element.
data = list(ONE_TEN)
swapFirstLast(data)
print("After swapping first and last: ", data)
#b. Demonstrate shifting to the right.
data = list(ONE_TEN)
shiftRight(data)
print("After shifting right: ", data)
#c. Demonstrate replacing even elements with zero.
data = list(ONE_TEN)
replaceEven(data)
print("After replacing even elements: ", data)
#d. Demonstrate replacing values with the larger of their
neighbors.
data = list(ONE_TEN)
replaceNeighbors(data)
print("After replacing with neighbors: ", data)
#e. Demonstrate removing the middle element.
data = list(ONE_TEN)
removeMiddle(data)
print("After removing the middle element(s): ", data)
#f. Demonstrate moving even elements to the front of the list.
data = list(ONE_TEN)
evenToFront(data)
print("After moving even elements: ", data)
#g. Demonstrate finding the second largest value.
print("The second largest value is: ",
secondLargest(ONE_TEN))
#h. Demonstrate testing if the list is in increasing order.
print("The list is in increasing order: ",
isIncreasing(ONE_TEN))
#i. Demonstrate testing if the list contains adjacent
duplicates.
print("The list has adjacent duplicates: ",
hasAdjacentDuplicate(ONE_TEN))
#j. Demonstrate testing if the list contains duplicates.
print("The list has duplicates: ", hasDuplicate(ONE_TEN))
main()
The output should look like this:
Run 1
>>>
====== RESTART: E:/IVC/CS10 Python/Homework/HW4
Files/HW4_sp2018_PS1.py ======
The original data for all functions is: [1, 2, 3, 4, 5, 6, 7, 8, 9,
10]
After swapping first and last: [10, 2, 3, 4, 5, 6, 7, 8, 9, 1]
After shifting right: [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]
After replacing even elements: [1, 0, 3, 0, 5, 0, 7, 0, 9, 0]
After replacing with neighbors: [1, 3, 4, 5, 6, 7, 8, 9, 10, 10]
After removing the middle element(s): [1, 2, 3, 4, 7, 8, 9, 10]
After moving even elements: [2, 4, 6, 8, 10, 1, 3, 5, 7, 9]
The second largest value is: 9
The list is in increasing order: True
The list has adjacent duplicates: False
The list has duplicates: False
>>>
Run 2
======= RESTART: E:/IVC/CS10 Python/Homework/HW4
Files/HW4Fa2018_Q1.py =======
The original data for all functions is: [12, 20, 10, 14, 54, 16,
75, 38, 79, 103]
After swapping first and last: [103, 20, 10, 14, 54, 16, 75, 38,
79, 12]
After shifting right: [103, 12, 20, 10, 14, 54, 16, 75, 38, 79]
After replacing even elements: [0, 0, 0, 0, 0, 0, 75, 0, 79, 103]
After replacing with neighbors: [12, 12, 14, 54, 54, 75, 75, 79,
103, 103]
After removing the middle element(s): [12, 20, 10, 14, 75, 38,
79, 103]
After moving even elements: [12, 20, 10, 14, 54, 16, 38, 75, 79,
103]
The second largest value is: 79
The list is in increasing order: False
The list has adjacent duplicates: False
The list has duplicates: False
>>>

More Related Content

Similar to CS10 Python Programming Homework 4 40 points Lists, Tupl.docx

E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
shandicollingwood
 
Hw5
Hw5Hw5
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source code
pradesigali1
 
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
Live Exam Helper
 
Unit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptxUnit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptx
Malla Reddy University
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
mary772
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
pasqualealvarez467
 
Learn C
Learn CLearn C
Learn C
kantila
 
project 1Assignment 1.pdf .docx
project 1Assignment 1.pdf                                .docxproject 1Assignment 1.pdf                                .docx
project 1Assignment 1.pdf .docx
wkyra78
 
Write a C program that implements a simple array-based insertion sort-.docx
Write a C program that implements a simple array-based insertion sort-.docxWrite a C program that implements a simple array-based insertion sort-.docx
Write a C program that implements a simple array-based insertion sort-.docx
SUKHI5
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapalooza
JenniferBall44
 
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and FuncCSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
MargenePurnell14
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
NileshBorkar12
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
Abhishek Tirkey
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
GauravPandey43518
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Sheila Sinclair
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
ash52393
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
shyaminfo04
 

Similar to CS10 Python Programming Homework 4 40 points Lists, Tupl.docx (20)

E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
 
Hw5
Hw5Hw5
Hw5
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source code
 
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
Python Exam (Questions with Solutions Done By Live Exam Helper Experts)
 
Unit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptxUnit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptx
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
 
Learn C
Learn CLearn C
Learn C
 
project 1Assignment 1.pdf .docx
project 1Assignment 1.pdf                                .docxproject 1Assignment 1.pdf                                .docx
project 1Assignment 1.pdf .docx
 
Write a C program that implements a simple array-based insertion sort-.docx
Write a C program that implements a simple array-based insertion sort-.docxWrite a C program that implements a simple array-based insertion sort-.docx
Write a C program that implements a simple array-based insertion sort-.docx
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapalooza
 
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and FuncCSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
CSE 1310 – Spring 21Introduction to ProgrammingLab 4 Arrays and Func
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 

More from mydrynan

CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docxCSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
mydrynan
 
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docxCSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
mydrynan
 
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
CSI Paper Grading Rubric- (worth a possible 100 points)   .docxCSI Paper Grading Rubric- (worth a possible 100 points)   .docx
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
mydrynan
 
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docxCSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
mydrynan
 
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docxCSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
mydrynan
 
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018  Ho.docxCSE422 Section 002 – Computer Networking Fall 2018  Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
mydrynan
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docx
mydrynan
 
CSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docxCSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docx
mydrynan
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
mydrynan
 
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docxCSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
mydrynan
 
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docxCryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
mydrynan
 
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docxCSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
mydrynan
 
CSCE 1040 Homework 2 For this assignment we are going to .docx
CSCE 1040 Homework 2  For this assignment we are going to .docxCSCE 1040 Homework 2  For this assignment we are going to .docx
CSCE 1040 Homework 2 For this assignment we are going to .docx
mydrynan
 
CSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docxCSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docx
mydrynan
 
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
mydrynan
 
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docxCSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
mydrynan
 
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docxCSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
mydrynan
 
CSC-321 Final Writing Assignment In this assignment, you .docx
CSC-321 Final Writing Assignment  In this assignment, you .docxCSC-321 Final Writing Assignment  In this assignment, you .docx
CSC-321 Final Writing Assignment In this assignment, you .docx
mydrynan
 
Cryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docxCryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docx
mydrynan
 
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docxCSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
mydrynan
 

More from mydrynan (20)

CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docxCSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
 
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docxCSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
 
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
CSI Paper Grading Rubric- (worth a possible 100 points)   .docxCSI Paper Grading Rubric- (worth a possible 100 points)   .docx
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
 
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docxCSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
 
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docxCSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
 
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018  Ho.docxCSE422 Section 002 – Computer Networking Fall 2018  Ho.docx
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docx
 
CSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docxCSCI 714 Software Project Planning and EstimationLec.docx
CSCI 714 Software Project Planning and EstimationLec.docx
 
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docxCSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
 
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docxCSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
 
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docxCryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
 
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docxCSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
 
CSCE 1040 Homework 2 For this assignment we are going to .docx
CSCE 1040 Homework 2  For this assignment we are going to .docxCSCE 1040 Homework 2  For this assignment we are going to .docx
CSCE 1040 Homework 2 For this assignment we are going to .docx
 
CSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docxCSCE509–Spring2019Assignment3updated01May19DU.docx
CSCE509–Spring2019Assignment3updated01May19DU.docx
 
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
 
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docxCSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docx
CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx
 
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docxCSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
 
CSC-321 Final Writing Assignment In this assignment, you .docx
CSC-321 Final Writing Assignment  In this assignment, you .docxCSC-321 Final Writing Assignment  In this assignment, you .docx
CSC-321 Final Writing Assignment In this assignment, you .docx
 
Cryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docxCryptography is the application of algorithms to ensure the confiden.docx
Cryptography is the application of algorithms to ensure the confiden.docx
 
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docxCSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
 

Recently uploaded

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 

Recently uploaded (20)

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 

CS10 Python Programming Homework 4 40 points Lists, Tupl.docx

  • 1. CS10 Python Programming Homework 4 40 points Lists, Tuples, Sets, and Files 1. You must turn in your program listing and output for each program set. Start a new sheet or sheets of paper for each program set. Each program set must have your student name, student ID, and program set number/description. All the program sets must be printed and submitted together with your Exam 4. Once you complete your Exam 4 and leave the classroom you will not be able to submit Homework 4. Late homework will not be accepted for whatever reasons you may have. ***************************************************** ***************************************************** ********************** for this homework, you are also to submit All Program Sets to Canvas under Homework 4 link ***************************************************** ***************************************************** ********************** a. Name your file : PS1_firstinitial_lastname.py for Program Set 1. PS means program set b. You still have to submit the paper copy together with the rest of the Homework 4. c. You have till 11:59pm the night before the day of Exam 4 to
  • 2. submit all Program Sets to Canvas. If the deadline is past, Program Sets will not be graded even if you submit the paper copy on time. d. You must submit both hardcopy and upload the Program Sets to Canvas to be graded. If you only submit the hardcopy or only upload to Canvas you will receive a zero for the Program Sets. You must submit all the hardcopies of all Program Sets of Homework 4. e. if you do not follow instructions on file naming provided in this section you will receive a zero for the whole of Homework 4. 2. You must STAPLE (not stapled assignments will not be graded resulting in a zero score) your programming assignment and collate them accordingly. Example Program set 1 listing and then output, followed by Program Set 2 listing and output and so on. 3. Please format you output properly, for example all dollar amounts should be printed with 2 decimal places. Make sure that your output values are correct (check the calculations). 4. Each student is expected to do their own work. IF IDENTICAL PROGRAMS ARE SUBMITTED, EACH IDENTICAL PROGRAM WILL RECEIVE A SCORE OF ZERO.
  • 3. Grading: Each program set must run correctly syntactically, logically, and display the correct output as specified. If the program set does not run correctly, a zero will be given. For each Program set, if the program executes properly with proper syntax, logic, and displays the correct output, then points will be deducted for not having proper: a. Comments (1 pt deducted for each occurrence) - Your name, description at the beginning of each program set. Short description of the what each section of your codes do. b. Consistency/Readability (2 pts deducted for each occurrence) - Spacing(separate each section of codes with a blank line - Indentation - Style (proper naming of variables no a,b,c – use descriptive and mnemonics) -each function must include type hints or annotations except for the main() -include docstrings for every function c. Required elements (2 pts deducted for each occurrence) - Use tools that have been covered in class - proper formatting for output when specified - all monetary values must be in 2 decimal places d. Output file, a zero will be given for
  • 4. that program set. to be displayed at the end of the program listing(codes) question. Provide your own test cases if the program set does not ask for any. The minimum test cases you provide on your own is 5 or more. If you provide less then 5 test cases per Program Set then that program set will receive a zero grade. Program Set 1 (40 points) Write list functions for items a to j that carry out the following tasks for a list of integers. a. Swap the first and last elements in the list. b. Shift all elements by one to the right and move the last element into the first position. For example, 1 4 9 16 25 would be transformed into 25 1 4 9 16. c. Replace all even elements with 0 (zeroes) d. Replace each element except the first and last by the larger of its two neighbors. e. Remove the middle element if the list length is odd, or the middle two elements if the length is even. f. Move all even element to the front, otherwise preserving the order of the elements. g. Return the second largest element in the list.
  • 5. h. Return true if the list is currently sorted in increasing order. i. Return true if the list contains two adjacent duplicate elements. j. Return true if the list contains duplicate elements (which need not be adjacent). The main() function to test each of the functions is included here for you. You must use the same function names that is provide for you below. Using other function names will result in a zero for this program. # Program to test functions a to j. # # Define constant variables. ONE_TEN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def main() : print("The original data for all functions is: ", ONE_TEN) #a. Demonstrate swapping the first and last element. data = list(ONE_TEN) swapFirstLast(data) print("After swapping first and last: ", data) #b. Demonstrate shifting to the right. data = list(ONE_TEN) shiftRight(data) print("After shifting right: ", data) #c. Demonstrate replacing even elements with zero. data = list(ONE_TEN) replaceEven(data) print("After replacing even elements: ", data) #d. Demonstrate replacing values with the larger of their
  • 6. neighbors. data = list(ONE_TEN) replaceNeighbors(data) print("After replacing with neighbors: ", data) #e. Demonstrate removing the middle element. data = list(ONE_TEN) removeMiddle(data) print("After removing the middle element(s): ", data) #f. Demonstrate moving even elements to the front of the list. data = list(ONE_TEN) evenToFront(data) print("After moving even elements: ", data) #g. Demonstrate finding the second largest value. print("The second largest value is: ", secondLargest(ONE_TEN)) #h. Demonstrate testing if the list is in increasing order. print("The list is in increasing order: ", isIncreasing(ONE_TEN)) #i. Demonstrate testing if the list contains adjacent duplicates. print("The list has adjacent duplicates: ", hasAdjacentDuplicate(ONE_TEN)) #j. Demonstrate testing if the list contains duplicates. print("The list has duplicates: ", hasDuplicate(ONE_TEN)) main()
  • 7. The output should look like this: Run 1 >>> ====== RESTART: E:/IVC/CS10 Python/Homework/HW4 Files/HW4_sp2018_PS1.py ====== The original data for all functions is: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] After swapping first and last: [10, 2, 3, 4, 5, 6, 7, 8, 9, 1] After shifting right: [10, 1, 2, 3, 4, 5, 6, 7, 8, 9] After replacing even elements: [1, 0, 3, 0, 5, 0, 7, 0, 9, 0] After replacing with neighbors: [1, 3, 4, 5, 6, 7, 8, 9, 10, 10] After removing the middle element(s): [1, 2, 3, 4, 7, 8, 9, 10] After moving even elements: [2, 4, 6, 8, 10, 1, 3, 5, 7, 9] The second largest value is: 9 The list is in increasing order: True The list has adjacent duplicates: False The list has duplicates: False >>> Run 2 ======= RESTART: E:/IVC/CS10 Python/Homework/HW4 Files/HW4Fa2018_Q1.py ======= The original data for all functions is: [12, 20, 10, 14, 54, 16, 75, 38, 79, 103] After swapping first and last: [103, 20, 10, 14, 54, 16, 75, 38, 79, 12] After shifting right: [103, 12, 20, 10, 14, 54, 16, 75, 38, 79] After replacing even elements: [0, 0, 0, 0, 0, 0, 75, 0, 79, 103] After replacing with neighbors: [12, 12, 14, 54, 54, 75, 75, 79, 103, 103] After removing the middle element(s): [12, 20, 10, 14, 75, 38, 79, 103] After moving even elements: [12, 20, 10, 14, 54, 16, 38, 75, 79, 103] The second largest value is: 79 The list is in increasing order: False The list has adjacent duplicates: False
  • 8. The list has duplicates: False >>>