Advertisement
AgungAlfiansyah

Untitled

Jun 29th, 2015
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.38 KB | None | 0 0
  1. def charcount(s):
  2.     s=s.lower()
  3.     list =[]
  4.     for i in s:
  5.         k=0
  6.         if i not in list:
  7.             list.append(i)      
  8.             for j in range(len(s)):
  9.                 if i == s[j]:
  10.                     k +=1
  11.             print 'count of char {0}:{1}'.format(i,k)
  12.      
  13.  
  14.  
  15. charcount ('Whereas recognition of the inherent dignity and of the equal\
  16. and inalienable rights of all members of the human family is the foundation \
  17. of freedom, justice and peace in the world, Whereas disregard and contempt \
  18. for human rights have resulted in barbarous acts which have outraged the \
  19. conscience of mankind, and the advent of a world in which human beings shall \
  20. enjoy freedom of speech and belief and freedom from fear and want has been \
  21. proclaimed as the highest aspiration of the common people, Whereas it is essential, \
  22. if man is not to be compelled to have recourse, as a last resort, to rebellion \
  23. against tyranny and oppression, that human rights should be protected \
  24. by the rule of law, Whereas it is essential to promote the development \
  25. of friendly relations between nations,Whereas the peoples of the \
  26. United Nations have in the Charter reaffirmed their faith \
  27. in fundamental human rights, in the dignity and worth of the human person \
  28. and in the equal rights of men and women and have determined to promote \
  29. social progress and better standards of life in larger freedom, \
  30. Whereas Member States have pledged themselves to achieve, in co-operation \
  31. with the United Nations, the promotion of universal respect for and observance \
  32. of human rights and fundamental freedoms,Whereas a common understanding of \
  33. these rights and freedoms is of the greatest importance for the full \
  34. realization of this pledge, \
  35. Now, Therefore THE GENERAL ASSEMBLY proclaims \
  36. THIS UNIVERSAL DECLARATION OF HUMAN RIGHTS as a common standard of achievement \
  37. for all peoples and all nations, to the end that every individual and every organ \
  38. of society, keeping this Declaration constantly in mind, shall strive by teaching \
  39. and education to promote respect for these rights and freedoms and by progressive \
  40. measures, national and international, to secure their universal and effective \
  41. recognition and observance, both among the peoples of Member States \
  42. themselves and among the peoples of territories under their jurisdiction\
  43. \
  44. ')
  45.  
  46. print charlist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement