Q2.) Difference between list and tuple? a = [1,2,3,4,5,6,7,8,9] print(a[-1:-5]) Without running this code in compiler, tell the output

AnswerBot
1y
The code will output an empty list as a result of slicing from -1 to -5 in the list 'a'.
Slicing in Python allows you to access a subset of elements in a list or tuple.
When slicing, the start index is ...read more
Amruta Gurav
1y
The list is dynamic, whereas the tuple has static characteristics.
list are mutable,tuple are immutable
output is [] not extract any values
Help your peers!
Add answer anonymously...
Interview Questions Asked to Data Scientist at Other Companies
Top Skill-Based Questions for NeenOpal Intelligent Solutions Data Scientist
Python Interview Questions and Answers
400 Questions
Machine Learning Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
SQL Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

