Guest User

Untitled

a guest
Nov 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. a= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  2. n = ''
  3. res = ''
  4. key = 1
  5. enter = input('').strip()
  6. def add (f):
  7. if f != '':
  8. f = int(f)
  9. f += key
  10. f = str(f)
  11. return f
  12. else:
  13. return n
  14.  
  15.  
  16. for i in enter:
  17. if a.count(i) == 0:
  18. if i.isnumeric():
  19. n += i
  20. else:
  21. n = add(n)
  22. res += n
  23. n= ''
  24. res += i
  25. else:
  26. n = add(n)
  27. res += n
  28. n = ''
  29. res += a([(a.index(i)+key)%len(a)])
  30.  
  31. n = add(n)
  32. res += n
  33. n =''
  34. print(res)
  35.  
  36. res += a([(a.index(i)+key)%len(a)])
  37.  
  38. Traceback (most recent call last):
  39. File "F:/PYCHARM PROGRAm/1/venv/Scripts/1333213213213.py", line 29, in <module>
  40. res += a([(a.index(i)+key)%len(a)])
  41. TypeError: 'str' object is not callable
  42.  
  43. a= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  44. n = ''
  45. res = ''
  46. key = 1
  47.  
  48. enter = input('').strip()
  49. abc11
  50.  
  51. def add (f):
  52. if f != '':
  53. f = int(f)
  54. f += key
  55. f = str(f)
  56. return f
  57. else:
  58. return n
  59.  
  60. for i,z in enumerate(enter):
  61. if a.count(z) == 0:
  62. if z.isnumeric():
  63. n += z
  64. else:
  65. n = add(n)
  66. res += n
  67. n= ''
  68. res += z
  69. else:
  70. n = add(n)
  71. res += n
  72. n = ''
  73. res += a[(a.index(z)+key)%len(a)]
  74.  
  75.  
  76. n = add(n)
  77. res += n
  78. n =''
  79. print(res)
  80. bcd12
Add Comment
Please, Sign In to add comment