Assessment: Methods: Lists and Strings

Assessment: Methods: Lists and Strings >> Python Basics

seqmut-1-2: Which method would you use to figure out the position of an item in a list?




✔️ Yes, index will return the position of the first occurance of an item.

Multiple Choice (assess_question4_1_1_2)

Score: 1.0 / 1

 

seqmut-1-3: Which method is best to use when adding an item to the end of a list?




✔️ Yes, though you can use insert to do the same thing, you don’t need to provide the position.

Multiple Choice (assess_question4_1_1_3)

Score: 1.0 / 1

 

Write code to add ‘horseback riding’ to the third position (i.e., right before volleyball) in the list sports.

 
 

ActiveCode (assess_ac4_1_1_4)

Expand DifferencesExpand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code to take ‘London’ out of the list trav_dest.

 
 
 
 
 

ActiveCode (assess_ac4_1_1_5)

Expand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code to add ‘Guadalajara’ to the end of the list trav_dest using a list method.

 
 
 
 
 

ActiveCode (assess_ac4_1_1_6)

Expand DifferencesExpand DifferencesExpand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code to rearrange the strings in the list winners so that they are in alphabetical order from A to Z.
 
 
 
 

ActiveCode (assess_ac4_1_1_7)

Expand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code to switch the order of the winners list so that it is now Z to A. Assign this list to the variable z_winners.
 
 
 
 
 

ActiveCode (assess_ac4_1_1_8)

Expand Differences

You passed: 100.0% of the tests