Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def palindromeRearranging(inputString):
- dictionary = {}
- x = 0
- odd_amount = 0
- while x < len(inputString):
- dictionary[inputString[x]] = inputString.count(inputString[x])
- x = x + 1
- x = 0
- for key, value in dictionary.items():
- if value % 2 != 0:
- odd_amount = odd_amount + 1
- if odd_amount <= 1:
- return True
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment