This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: used for the slice operator? 3. If we write this at the Python shell prompt: >>> team = "Gauchos" then type each of the following at the shell prompt, what will the result be? a. (3 pts) >>> team b. (3 pts) >>> team[0:2] c. (3 pts) >>> team[-1] d. (3 pts) >>> team[1:3] 4. (10 pts) Read Section 3.2.5. Then answer: There is a "string method "that will convert the variable team to all capital letters, i.e. return GAUCHOS instead of gauchos? What do we write if we want to assign the varible teamUC to be team, converted to upper case? Hint: The correct answer is NOT teamUC = "GAUCHOS" Please turn over for more problems Continued from other side 5. (10 pts) (problem 2.3 from page 81 in the textbook.) Write a function to compute the area of a circle with a radius of r. Use n as the parameter to the function. Use the value of pi from the math module....
View Full Document
- Fall '09