Advertisement
Ombashi

Random seating

Feb 6th, 2025
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import random
  2. """
  3. Switch a student from a random seat on the left  (cols 1 to 15)
  4. to a random seat on the right (cols 16 to 30)
  5. Seat rows are 1 to 20
  6. """
  7. rowNumL = random.randint(1, 20)  # 1 to 20 rows left
  8. colNumL = random.randint(1, 15)  # 1 to 15  columns left
  9. rowNumR = random.randint(1, 20)  # 1 to 20 rows right
  10. colNumR = random.randint(16, 30) # 16 to 30 columns right
  11.  
  12. print(f'Move from row {rowNumL} col {colNumL} to row {rowNumR} col {colNumR}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement