Exam 1- 2013

Your code should only print the requested output you

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: " try: z = int(y) print("lion") except ValueError: print("tiger") print("jaguar") CS 115 Exam 1, Spring 2013 Page 4 of 8 Problem 2: Short snippets of code (30 points) Write snippets of code to do the following. Your code should only print the requested output. You will lose points for printing additional output. You can assume that all your snippets are enclosed within a main function and that any necessary libraries have been imported. You only need to write the specific lines of code that accomplish each task. Do not use sys.exit() in your solutions...
View Full Document

Ask a homework question - tutors are online