aneliabogeva

Exercises

Jul 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. class Exercise:
  2. def __init__(self, topic, course_name, judge_contest_link, problems):
  3. self.topic = topic
  4. self.course_name = course_name
  5. self.judge_contest_link = judge_contest_link
  6. self.problems = problems
  7.  
  8. list_objects = []
  9. exersices = input().split(" -> ")
  10. while not exersices[0] == 'go go go':
  11. problems_list = exersices[-1].split(', ')
  12. object = Exercise(exersices[0], exersices[1],exersices[2], problems_list)
  13. list_objects.append(object)
  14.  
  15. exersices = input().split(" -> ")
  16.  
  17.  
  18. for excercise in list_objects:
  19. print(f"Exercises: {excercise.topic}")
  20. print(f'Problems for exercises and homework for the "{excercise.course_name}" course @ SoftUni.')
  21. print(f'Check your solutions here: {excercise.judge_contest_link}')
  22. counter = 1
  23. for problem in excercise.problems:
  24. print(f'{counter}. {problem}')
  25. counter +=1
Add Comment
Please, Sign In to add comment