Guest User

Untitled

a guest
Jun 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. '''
  2.  
  3.  
  4. '''
  5. prob_dict = {'a':'1','b':'2','c':'3','d':'4','e':'5','f':'6'}
  6. print("city = S")
  7. while True:
  8. problem = list(map(str,input("enter problems").split()))
  9. if set(problem)&set(prob_dict.keys()):
  10. break
  11. else:
  12. print("oops,give alphabets as input")
  13. solution = ['7']#common solution
  14. for i in problem:
  15. solution += prob_dict[i]
  16.  
  17. solution_int = []
  18. solution_int += [int(x) for x in solution]
  19. print(sorted(solution_int))
Add Comment
Please, Sign In to add comment