techred home > CSC-101-DA

Whose my neighbor? Intro project specifiations and extension exercises

Extension exercises

  1. Add a second question to ask each user and this time ask for a string response. Store the string responses in a list as well and when the exit code is reached, just print all responses with a pretty header
  2. Ask each user for their name and use their name as the key in a dictionary and store their numeric answer as the value in their dedicated entry. When the stop code is reached, display the dictionary results prettily with the user name then a colon and then the user's response.
  3. Use try and except to provide the user a meaningful error code if they enter a non-integer response to your question.