Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import sys
  2.  
  3. while True:
  4.     total_list = []
  5.     character = ''
  6.     result = ''
  7.     inputcode = input('LETTR $ ') + '-'
  8.  
  9.     inputcode.replace('/', '-')
  10.  
  11.     if inputcode == 'x':
  12.         sys.exit()
  13.        
  14.     for i in range(len(inputcode)):
  15.         if inputcode[i] not in ('-','/'):
  16.             character += inputcode[i]
  17.         else:
  18.             total_list.append(character)
  19.             character = ''
  20.  
  21.     # debug  
  22.     print(total_list)
  23.     print(inputcode)
  24.  
  25.     i = 0
  26.  
  27.     for element in total_list:
  28.         total_list[i] = chr(int(element))
  29.         result += str(chr(int(element)))
  30.         i += 1
  31.  
  32.     print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement