From f01094c6acb4ebe459b909ff98ea8bb07e32a504 Mon Sep 17 00:00:00 2001 From: pratiksinghchauhan Date: Sun, 24 Mar 2019 22:00:46 +0530 Subject: [PATCH] added interest file --- interest.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 interest.py diff --git a/interest.py b/interest.py new file mode 100644 index 0000000..96e138b --- /dev/null +++ b/interest.py @@ -0,0 +1,23 @@ +import os +curDir = os.getcwd() +exists = os.path.isfile(curDir + '/interest.json') + +if not exists: + print ("Please Select five intrest from below:") + givenChoices = [" 1. Artificial Intelligence "," 2. Backtracking "," 3. Bit Manipulation "," 4. Cellular automation "," 5. Compression "," 6. Computational Geometry "," 7. Computer Grapchics "," 8. Data Structures "," 9. Design Pattern "," 9. Divide Conquer "," 10. Dynamic Programming "," 11. Filters "," 12. Game Theory "," 13. Graph Algorithms "," 14. Greedy Algorithms "," 15. Mathmatical Algorithms "," 16. Networking "," 17. Numerical Analysis "," 18. Online Challenges "," 19. Operating System "," 20. Randomized Algorithms "," 21. Search "," 22. Selection Algorithms "," 23. Sorting "," 24. Square Root Decomosition "," 25. String Algorithms "," 26. Theory of Computuation "," 27. Misc "," 28. Utility "] + for data in givenChoices: + print data + print("Enter at most five numbers saperated by space") + choices = raw_input() + choices = choices.split(" ") + print choices + outArray = [] + for data in choices: + outArray.append(givenChoices[int(data)-1]) + + print outArray + with open(curDir + '/interest.json', 'w') as outfile: + for data in choices: + outfile.write(givenChoices[int(data)-1] + "\n") + +