Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import sys
  2.  
  3.  
  4.  
  5. def reverse(word):
  6. return word[::-1]
  7.  
  8.  
  9. while True:
  10. a = (sys.argv[1])
  11.  
  12.  
  13. if a.count('"') == 2:
  14. print reverse(a.strip('"'))
  15.  
  16.  
  17. elif a.count(' ')>0:
  18. print "Wrong amount of parameters!"
  19. sys.exit()
  20.  
  21.  
  22. elif a == '':
  23. print "Wrong amount of parameters!"
  24. sys.exit()
  25. else:
  26. print reverse(a.strip('"'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement