Advertisement
pacho_the_python

ASCII Simulator

Mar 15th, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. symbol_1 = input()
  2. symbol_2 = input()
  3. word = input()
  4.  
  5. start = ord(symbol_1)
  6. end = ord(symbol_2)
  7.  
  8. symbol_string = ""
  9.  
  10. for i in range(start, end):
  11.     symbol_string += chr(i)
  12.  
  13. find_symbols = []
  14. for x in word:
  15.     if x in symbol_string:
  16.         find_symbols.append(x)
  17.  
  18. total = 0
  19.  
  20. for j in find_symbols:
  21.     total += ord(j)
  22.  
  23. print(total)
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement