Question 11
Complete the function get_second_item(items) that takes a list and returns the second item. Assume the input is always a list containing at least two elements.
For example, get_second_item([10, 20, 30]) should return 20.
def get_second_item(items):
# TODO: Return the second item from the list
pass
For example, get_second_item([10, 20, 30]) should return 20.
def get_second_item(items):
# TODO: Return the second item from the list
pass
Question 12
A program needs to display only positive, non-zero numbers from a list containing a mixture of integer and decimal values. Which conditional statement should be placed inside the loop?
Question 13
Which loop structure processes every individual item in a list called grades?
Question 14
What distinguishes a terminal-based Python environment from other development environments?
Question 15
Which keyword is used to exit a loop prematurely in Python?
