-
-
Save aadityabhatia/86077fea4ccd353bfb017df733a70d19 to your computer and use it in GitHub Desktop.
Classroom Seating Chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a1 = [ | |
| "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" | |
| ] | |
| from random import shuffle | |
| def printSeatChart(roster): | |
| # add empty strings to make the class size 17 | |
| roster += [""] * (17 - len(roster)) | |
| # shuffle the list | |
| shuffle(roster) | |
| # add one more to block seat #6 | |
| if len(roster) == 17: | |
| roster = roster[:5] + [""] + roster[5:] | |
| print("DOOR".ljust(24) + "WHITEBOARD".center(24) + "INSTRUCTOR".center(24)) | |
| print('*' * 84) | |
| for i in range(0, len(roster), 6): | |
| for j in range(3): | |
| print(f"{roster[i+j]:^12}", end="") | |
| print(' ' * 12, end="") | |
| for j in range(3, 6): | |
| print(f"{roster[i+j]:^12}", end="") | |
| print() | |
| print('*' * 84) | |
| print("REAR".center(84)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment