-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6.py
More file actions
27 lines (20 loc) · 642 Bytes
/
6.py
File metadata and controls
27 lines (20 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
"""6.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/18qtsCM2E0FUMOlrTWAnlvnc9Tfcsc3po
"""
listOne = [3, 6, 9, 12, 15, 18, 21]
listTwo = [4, 8, 12, 16, 20, 24, 28]
odd_index=[]
even_index=[]
odd_index=listOne[1::2]
even_index=listTwo[0::2]
listThree=[]
#listThree.append(odd_index)
#print(listThree)
listThree.extend(odd_index)
listThree.extend(even_index)
print("Element at odd-index positions from list one:", odd_index)
print("Element at even-index positions from list two:" ,even_index)
print("Printing Final third list:",listThree)