Advertisement
Artim_Anton

Untitled

Aug 20th, 2020
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import numpy as np
  2. from array import *
  3.  
  4. str = "Hello world!!"
  5.  
  6. alfavit = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  7.  
  8. n = 1
  9. col = array('i', [0])
  10. while n < len(alfavit):
  11.     col.append(0)
  12.     n = n + 1
  13.  
  14.  
  15. i = 0
  16. j = 0
  17.  
  18. while i < len(str):
  19.     while j < len(alfavit):
  20.         if alfavit[j] == str[i]:
  21.             col[j] = col[j] + 1
  22.         j = j + 1
  23.     j = 0
  24.     i = i + 1
  25.  
  26. print(col[11])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement