Lab2.instructions

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 1

CIS 41A - Lab 2: arithmetic, IO, graphics
In one Python file called lab2.py, write code for 2 problems from the textbook.
1. (P2.17)
Write a program that reads in two times in military format (0900, 1730) and prints the number
of hours and minutes between the two times. You can assume the input time is always a valid,
4-digit number.
Example output (user input in blue):
Please enter the start time: 0900
Please enter the end time: 1730
8 hours, 30 minutes
2. (P2.30)
Write a program that displays the Olympic rings. Color the rings in the Olympic colors.
In addition to the graphics methods shown in the class notes, use the Source Assistant feature
of the IDE to help you set the pen size so it's thicker than the default size.
Example output:
When done testing, upload your lab2.py to Canvas. Please use this exact filename.

Navigation menu