Advertisement
xSniperq

Memo trening

Aug 24th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import time
  2. import os
  3. import random
  4.  
  5. quantity = int(input("Ilość znaków do memo: "))
  6. signs = 'abcdefghijklmnoprstuwz'
  7. start_time = time.time()
  8. memo = ''
  9. if quantity > 22:
  10.     quantity = 22
  11. while quantity > 0:
  12.     randomsign = random.choice(signs)
  13.     print(randomsign)
  14.     input('Enter')
  15.     os.system("cls")
  16.     memo = memo + randomsign
  17.     signs = signs.replace(randomsign, '')
  18.     quantity -= 1
  19. memory = input('Podaj litery w odpowieniej kolejności:')
  20. end_time = time.time()
  21. czas = str(end_time - start_time)
  22. if memory == memo:
  23.     print('Gratulacje, udało ci się zapamiętać w: ' + czas)
  24. else:
  25.     print('Niestety znaki są niepoprawne')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement