Compsci 6, Fall 2011, Classwork 5

PRINT Names and NetID of students in group (min 2, max 3)
Name: __________________________ NetID: _____________   Name: __________________________   NetID: _____________

Name: __________________________ NetID: _____________

Problem Solving

These questions are related to program Uppity.py

  1. In the function main there is a variable defined that has the type string or str (Python style). What is the variable and what are the clues that it is a string?
     
    
    
    
    
  2. What is the type of the parameter filename in the function uppify_file? How do you know?
    
    
    
    
    
  3. The variable uwords in uppify_file has the type list. What clues would help you determine this?
    
    
    
    
    
  4. There is a string method used in the function uppify_list. What is the method and what are the clues that it is a string method?
    
    
    
    
    
  5. The function print_list prints exactly one line of output. This is in part because one of the print statements in the function uses a comma -- explain what you think the role of the comma is.
    
    
    
    
  6. Consider the following replacement code for uppify_list. for w in words: w = w.upper() return words

    The program doesn't work the same. What happens and why is it different?