Posted By

maturanti19 on 05/29/19


Tagged

3 V za tajne spravy kazdu samohlasku vymen dalsie pismeno abecede


Versions (?)

vymen kazdu samohlasku za dalsie pismeno v abecede


 / Published in: Python
 

s kamaratmi si chcete posielat tajne spravy kazda samohlaska sa posunie o jedno pismenko v abecede napr a za b atd

  1. x=int(input('Zadaj sirku pola: '))
  2. y=int(input('Zadaj vysku pola: '))
  3.  
  4. import tkinter
  5. from random import *
  6. p=tkinter.Canvas(height=y, width=x, bg='white')
  7. p.pack()
  8.  
  9. def oslava_terc():
  10. if y>=x:
  11. w=x//2
  12. while w>0:
  13. farba=choice(('red','lightblue','pink','green','teal','orange','gold','crimson','slateblue','dodgerblue','mediumorchid','yellowgreen','seagreen','yellow'))
  14. p.create_oval(x//2-w, y//2-w, x//2+w, y//2+w, fill=farba )
  15. w=w-10
  16. if x>=y:
  17. w=y//2
  18. while w>0:
  19. farba=choice(('red','lightblue','pink','green','teal','orange','gold','crimson','slateblue','dodgerblue','mediumorchid','yellowgreen','seagreen','yellow'))
  20. p.create_oval(x//2-w, y//2-w, x//2+w, y//2+w, fill=farba )
  21. w=w-10
  22. oslava_terc()
  23.  
  24.  
  25.  
  26. ret=str(input('Zadaj retazec: '))
  27. s=['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','z']
  28. x=''
  29. d=[]
  30. for i in range(len(ret)):
  31. if ret[i]=='a':
  32. ret1=ord(ret[i])
  33. x=x+chr(ret1+1)
  34. d.append(x)
  35. if ret[i]=='e':
  36. ret1=ord(ret[i])
  37. x=x+chr(ret1+1)
  38. d.append(x)
  39. if ret[i]=='o':
  40. ret1=ord(ret[i])
  41. x=x+chr(ret1+1)
  42. d.append(x)
  43. if ret[i]=='u':
  44. ret1=ord(ret[i])
  45. x=x+chr(ret1+1)
  46. d.append(x)
  47. if ret[i]=='y':
  48. ret1=ord(ret[i])
  49. x=x+chr(ret1+1)
  50. d.append(x)
  51. if ret[i]==s[0]:
  52. ret1=ord(ret[i])
  53. x=x+chr(ret1)
  54. d.append(ret)
  55. if ret[i]==s[0]:
  56. ret1=ord(ret[i])
  57. x=x+chr(ret1)
  58. d.append(ret)
  59. if ret[i]==s[0]:
  60. ret1=ord(ret[i])
  61. x=x+chr(ret1)
  62. d.append(ret)
  63. if ret[i]==s[1]:
  64. ret1=ord(ret[i])
  65. x=x+chr(ret1)
  66. d.append(ret)
  67. if ret[i]==s[2]:
  68. ret1=ord(ret[i])
  69. x=x+chr(ret1)
  70. d.append(ret)
  71. if ret[i]==s[3]:
  72. ret1=ord(ret[i])
  73. x=x+chr(ret1)
  74. d.append(ret)
  75. if ret[i]==s[4]:
  76. ret1=ord(ret[i])
  77. x=x+chr(ret1)
  78. d.append(ret)
  79. if ret[i]==s[5]:
  80. ret1=ord(ret[i])
  81. x=x+chr(ret1)
  82. d.append(ret)
  83. if ret[i]==s[6]:
  84. ret1=ord(ret[i])
  85. x=x+chr(ret1)
  86. d.append(ret)
  87. if ret[i]==s[7]:
  88. ret1=ord(ret[i])
  89. x=x+chr(ret1)
  90. d.append(ret)
  91. if ret[i]==s[8]:
  92. ret1=ord(ret[i])
  93. x=x+chr(ret1)
  94. d.append(ret)
  95. if ret[i]==s[9]:
  96. ret1=ord(ret[i])
  97. x=x+chr(ret1)
  98. d.append(ret)
  99. if ret[i]==s[10]:
  100. ret1=ord(ret[i])
  101. x=x+chr(ret1)
  102. d.append(ret)
  103. if ret[i]==s[11]:
  104. ret1=ord(ret[i])
  105. x=x+chr(ret1)
  106. d.append(ret)
  107. if ret[i]==s[12]:
  108. ret1=ord(ret[i])
  109. x=x+chr(ret1)
  110. d.append(ret)
  111. if ret[i]==s[13]:
  112. ret1=ord(ret[i])
  113. x=x+chr(ret1)
  114. d.append(ret)
  115. if ret[i]==s[14]:
  116. ret1=ord(ret[i])
  117. x=x+chr(ret1)
  118. d.append(ret)
  119. if ret[i]==s[15]:
  120. ret1=ord(ret[i])
  121. x=x+chr(ret1)
  122. d.append(ret)
  123. if ret[i]==s[16]:
  124. ret1=ord(ret[i])
  125. x=x+chr(ret1)
  126. d.append(ret)
  127. if ret[i]==s[17]:
  128. ret1=ord(ret[i])
  129. x=x+chr(ret1)
  130. d.append(ret)
  131. if ret[i]==s[18]:
  132. ret1=ord(ret[i])
  133. x=x+chr(ret1)
  134. d.append(ret)
  135. if ret[i]==s[19]:
  136. ret1=ord(ret[i])
  137. x=x+chr(ret1)
  138. d.append(ret)
  139. if ret[i]==' ':
  140. ret1=ord(ret[i])
  141. x=x+chr(ret1)
  142. d.append(ret)
  143. d=d[::-1]
  144. print(d[1])
  145.  
  146. ##ret=str(input('Zadaj retazec: '))
  147. ##s=['a','e','i','o','u','y']
  148. ##x=''
  149. ##for i in range (len(ret)):
  150. ## if ret[i]==s[0:5]:
  151. ## ret1=ord(ret[i])
  152. ## x=x+chr(ret1+1)
  153. ##
  154. ##print(x)
  155.  
  156.  
  157.  
  158. ##mes=input('Zadaj spravu na kodovanie')
  159. ##s='aeiouy'
  160. ##r='bcdfghjklmnpqrstvwxz'
  161. ##key=1
  162. ##q=0
  163. ##n=''
  164. ##t=''
  165. ##for character in mes:
  166. ## pos=s.find(character)
  167. ## m=(pos+key)%26
  168. ## f=s[m]
  169. ## n+=f
  170. ##print('Zakodovana sprava je: ', n)

Report this snippet  

You need to login to post a comment.