SHARE
TWEET

Untitled

a guest Jan 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2.  
  3. ft = open("teachers.txt", "r")
  4. fsp = open("speciality.txt", "r")
  5. fst = open("students.txt", "r")
  6. fsubj = open("subjects.txt", "r")
  7. fout = open("output.txt", "w")
  8.  
  9. sp = [str.strip(" \n") for str in fsp]
  10.  
  11. fout.write("prepodi:\n")
  12. for str in ft:
  13.   fout.write(str.strip(" \n") + " " + random.choice(sp) + "\n")
  14.  
  15. fout.write("\nstudenti:\n")
  16. for str in fst:
  17.   fout.write(str.strip(" \n") + "\n")
  18.  
  19. fout.write("\npredmeti:\n")
  20. for str in fsubj:
  21.   fout.write(str[3:].strip(" \n") + "\n")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top