If x = [10, 20, 30, 40, 50], what is the output of print(x[-2])?
- 20
- 30
- 40
- 50
The output is the element at the index -2 in the list, which is 40. Negative indexing counts elements from the end of the list.
Loading...
Related Quiz
- For an e-commerce website, which KPI effectively measures customer retention and loyalty?
- In data scraping, what type of HTML element attribute is commonly used to identify specific data points?
- The technique of _______ is used in data-driven decision making to understand the potential outcomes of different decisions.
- When applying a moving average model in time series analysis, what does the moving average primarily smooth out?
- ______ Score' is a popular metric for gauging overall customer experience and satisfaction.