Assignments 1 : Variables & Lists

Write the answers of the questions in the available space.
In this assignment, we are trying to make an inventory list.
  1. Make a variable greeting and assign the following string: Here's an inventory list. Then, print that variable.
  2. Make two variables item_1 and item_2, then put pencil in item_1 and pen in item_2. Using only one print command, print the two variables so it has the following output (notice the tab in the beginning)
    - Pencil
    - Pen
  3. Write item_3 = " book ". Try to get rid of the whitespace and then print the following
    - Book
  4. Make three variables no_item_1, no_item_2, no_item_3, each has the value 2, 3, 4, consecutively. Using those variables print the following: (The number 9 came from the sum of the three items together).
    The number of pencil is 2.
    The number of pen is 3.
    The number of book is 4.
    We have a total of 9 items.
  5. Make a list consisting of item_1, item_2, and item_3, call it items.
  6. Make a new variable item_4 which has the value ruler . Add that variable to the end of list. Then print "We added {item_4} to the list."
  7. Make a new variable item_5 which has the value sharpener . Add that variable to the beginning of list. Then print "We added {item_5} to the list."
  8. Remove the element with index 2 from the list. Then print, "we remove {element with index 2} from the list."
  9. Try to sort the items list alphabetically. Then print "Here's the sorted list of our items" followed by printing the list.
  10. Using len function for the length of list, print the following: "The number of different items in our list is {length of list}."