IT 116: Introduction to Scripting
Class 26 Ungraded Quiz

  1. Are strings sequences?


  2. What are the elements of a string?


  3. Write a Python expression that returns the first character in the string team.


  4. Write a Python expression that returns the last character in the string team.


  5. Can you use a negative number as an index to a string?


  6. If the string variable team is assigned the value "Red Sox", what does the following expression return?
    team[-1]



  7. Can a string be changed?


  8. Write a Python expression that returns a string consisting of the first 3 characters in the string team.


  9. Write a Python expression that returns a string consisting of the last 3 characters in the string team.


  10. Write a loop to print the individual characters of a the string team with each character appearing on a separate line.