Pre-Summer Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

Which for loop correctly iterates through a list of student names?

A.

for name in [ ' Alice ' , ' Bob ' , ' Carol ' ]:

B.

for name with [ ' Alice ' , ' Bob ' , ' Carol ' ]:

C.

for name from [ ' Alice ' , ' Bob ' , ' Carol ' ]:

D.

for name = [ ' Alice ' , ' Bob ' , ' Carol ' ]

Which Python data structure contains only unique elements and does not support indexing?

A.

List

B.

Tuple

C.

Dictionary

D.

Set

What determines which lines of code are executed when the condition is true in a Python if statement?

A.

Lines that are enclosed in parentheses

B.

Lines that share the same indentation level

C.

Lines that end with semicolons

D.

Lines that are enclosed in square brackets

In the code for item in my_list:, what does item represent?

A.

The index of the current element

B.

The current element being processed

C.

The length of the list

D.

The entire list

Fix the indexing error in this function that should return the last character of a string.

def get_last_character(text):

return text[len(text)]

What happens when theRunbutton is clicked in a Python development environment?

A.

A file browser window opens.

B.

The currently open Python script is executed.

C.

The file is saved without being executed.

D.

The code is converted to a different programming language.

Fix the missing return statement in this function that should return whether a number is even.

def is_even(number):

if number % 2 == 0:

True

else:

False

Which components are required in every Python for loop?

A.

A variable, an iterable, and an indented code block

B.

A condition, a counter, and a break statement

C.

A function call, a parameter, and a return value

D.

A list index, a range limit, and a step value

Which punctuation mark must appear at the end of an if statement line?

A.

; semicolon

B.

: colon

C.

. period

D.

, comma

Complete the function update_grade(grades, student, new_grade) that takes a grades dictionary, a student name, and a new grade, then updates that student ' s grade and returns the dictionary.

For example, update_grade({ " Alice " : 85, " Bob " : 90}, " Alice " , 95) should return { " Alice " : 95, " Bob " : 90}.

A.

def update_grade(grades, student, new_grade):grades[student] = new_gradereturn grades

B.

def update_grade(grades, student, new_grade):student = new_gradereturn student

C.

def update_grade(grades, student, new_grade):grades.append(new_grade)return grades

D.

def update_grade(grades, student, new_grade):pass