5. Create a python list containing elements 2,4,6,8,10,12,14,16 in this order and change the elements as given- 2,3,6,7,10,11,14,15 .
For class 9th...
Answers
Answered by
1
"""
Project Type: Brainly Answer
Date Created: 10-02-2021
Date Edited Last Time: ---NIL---
Question Link: https://brainly.in/question/34954085
Question: Create a python list containing elements
2,4,6,8,10,12,14,16 in this order and change the elements
as given- 2,3,6,7,10,11,14,15.
Program Created By: atrs7391
Programming Language: Python
Language version (When program created or last edited): Python 3.9.1
"""
nlist = [2, 4, 6, 8, 10, 12, 14, 16]
print("List before changes: ", nlist)
for i in range(9):
if i % 2 == 1:
nlist[i] = nlist[i]-1
print("Final list after changes: ", nlist)
Similar questions