Write a program to print the first half values in one line and the last half values in one line.
b) With a given tuple (1,2,3,4,5,6,7,8,9,10), write a program to print the first half values in one line and the last half values in one line.
Aim: A given tuple (1,2,3,4,5,6,7,8,9,10), write a program to print the first half values in one line and the last half values in one line.
Step2. declare tp and assign values from 1 to 10.
Step3. Assign first 5 values of tp to tp1
Step4. Assign Last 5 values of tp to tp2
Step6. Print tp2.
(1, 2, 3, 4, 5)
(6, 7, 8, 9, 10)
- Insert method , Remove Data From List , Remove Item From Position or from index , Remove method , Delete statement , Looping in list In Python
- list is data structure , oder collection , Append method , Extend method , Join List , Python
- Max and Min , Conversion of Tuple into list,string or list into tuple and it type , in Python
- Tuple without parenthesis , Tuple unpacking , list inside tuples Python
- While Loop and tuple in Python | find type of element and tuple with one element
- About Tuple in Python with examples | For loop and tuple | count , index len function slicing | Nested lists are obtained using nested indexing
- fromkeys method | copy method | clear method | get method in dictionary | python
- Python Dictionary | update() method
- Python Dictionary | Add data , POP , popitem , update method
- Generate a list and tuple with comma-separated numbers
- Define a function which generates Fibonacci series up to n numbers