Task 2 Assume, you have been given a tuple. Write a Python program that creates a new tuple excluding the first and last two elements of the given tuple and prints the new tuple. Hint: You may use...


Must show it in Python:
Please show step by step with comments.
Please show it in simplest form.
Please don't use any functions
Please don't use any def func ()
Input and Output must match with the Question
Please go through the Question very carefully.


Task 2<br>Assume, you have been given a tuple. Write a Python program that creates a new tuple excluding the first and last two elements of the given tuple and<br>prints the new tuple.<br>Hint: You may use tuple slicing.<br>Sample Input 1:<br>(10, 20, 24, 25, 26, 35, 70)<br>Sample Output 1:<br>(24, 25, 26)<br>==== ===<br>Sample Input 2:<br>(-10, 20, 30, 40)<br>Sample Output 2:<br>!===== ===== =================<br>Sample Input 3:<br>(-10, 20, 25, 30, 40)<br>Sample Output 3:<br>(25,)<br>=====<br>====== ======<br>

Extracted text: Task 2 Assume, you have been given a tuple. Write a Python program that creates a new tuple excluding the first and last two elements of the given tuple and prints the new tuple. Hint: You may use tuple slicing. Sample Input 1: (10, 20, 24, 25, 26, 35, 70) Sample Output 1: (24, 25, 26) ==== === Sample Input 2: (-10, 20, 30, 40) Sample Output 2: !===== ===== ================= Sample Input 3: (-10, 20, 25, 30, 40) Sample Output 3: (25,) ===== ====== ======

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here