Techne 6

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

max(["Roland", "Kent", "Ravi", "Amy"]) What is the result of the code?

"Roland"

states = ["Alaska", "Hawaii", "Florida", "Maine", "Ohio", "Florida"] states.remove("Florida") After it exicutes, what is the value of 'states'?

Alaska, Hawaii, Maine, Ohio, Florida

x = 0 for i in range(1, len(values)) : if values[i] > values[x] : x = i What does this code do?

Finds the largest item in values and stores it in x

What will happen when the following code is executed? values = [1.618, 2.71, 3.14] print(values[3])

It will give an out of range error

states = ["Alaska", "Hawaii", "Florida", "Maine", "Ohio", "Florida"] removedValue = states.pop(3) What is the value of the removedValue?

Maine

What output is generated by this code? table = [["T", "U", "V"], ["W", "X", "Y"]] print(table[1][1])

X

words = ["Mary", "had", "a", "little", "lamb"] sentence = str(words) what is the result?

['marry' 'had' 'a' 'little' 'lamb']

what is in values after the following values = [1, 2, 3] values = values * 4

[1,2,3,1,2,3,1,2,3]

x = [5, 3, 7, 9, 1] y = x[3 : ] print(y) what is the output once it exicutes?

[9:1]

what is printed? somelist = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] for i in range(0, len(somelist), 2) : print(somelist[i], end = "")

acegikmoqsuwy

given a list of values that contains the first 10 prime numbers, what does not display all of the digits?

for i in range(1, len(values)) : print(values[i])

What type of search inspects every element sequentially?

linear search

words = ["Mary", "had", "a", "little", "lamb"] sentence = "" for word in words : sentence = sentence + word

marryhadalittlelamb

Which statement(s) allows us to initialize the list numbers with 10 elements all set to zero?

numbers = [0] * 10

table = [["T", "U", "V"], ["W", "X", "Y"]] What will display 'Y'?

print(table[len(table) - 1][len(table[1]) - 1])

What does this code segment do?

x = [] for i in range(5) : ` x.append([]) for j in range(3) : x[i].append(0)


Kaugnay na mga set ng pag-aaral

ACloud Guru Certified Cloud Practitioner Practice Exam

View Set

Chapter 26 Study Guide Questions

View Set