first
This commit is contained in:
parent
f92025c1a6
commit
6c29a7875b
@ -52,3 +52,4 @@ Create a new decrypt function. Take an already encrypted string, and the shift n
|
||||
#### Round 4
|
||||
|
||||
Using Python's `assert` write at least 6 tests to test your code output.
|
||||
|
@ -7,7 +7,7 @@ Management wants to figure out how many people visit each room in the gallery, a
|
||||
|
||||
Your goal is to write a program that takes a formatted text file that describes the overall gallery's foot-traffic on a minute-to-minute basis. From this data you must compute the average time spent in each room, and how many visitors there were in each room.
|
||||
|
||||
###The Input
|
||||
### The Input
|
||||
|
||||
Each line in the text file represents either a visitor entering or leaving a room. It starts with an integer, representing a visitor's unique identifier. Next on this line is another integer, representing the room's number. Next is a single character, either 'I' (for "In") for this visitor entering the room, or 'O' (for "out") for the visitor leaving the room. Finally, at the end of this line, there is a time-stamp integer: it is an integer representing the minute the event occurred during the day. All of these elements are space-delimited.
|
||||
|
||||
@ -22,7 +22,7 @@ Sample Input:
|
||||
0 0 O 560
|
||||
1 0 O 560
|
||||
|
||||
###The Output
|
||||
### The Output
|
||||
|
||||
For each room that had log data associated with it, print the room number, then print the average length of time visitors have stayed as an integer, and then finally print the total number of visitors in the room. All of this should be on the same line and be space delimited; you may optionally include labels on this text, like in our sample output 1.
|
||||
|
||||
@ -30,8 +30,8 @@ Sample Output:
|
||||
|
||||
Room 0, 20 minute average visit, 2 visitor(s) total
|
||||
|
||||
###Loading the Text File
|
||||
### Loading the Text File
|
||||
|
||||
You'll find a text file `traffic.txt` in this repo. Import this text file and parse it to get the results.
|
||||
|
||||
When you are done solving the problem, write your output to another text file and save it in the repo.
|
||||
When you are done solving the problem, write your output to another text file and save it in the repo.
|
Loading…
x
Reference in New Issue
Block a user