Advertisement
FanaticExplorer

find_type

Sep 26th, 2022
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | Source Code | 0 0
  1. import string
  2. user_input=input("Введіть дані: ") #считуємо
  3. for sym in string.ascii_letters: #беремо символ
  4.     if sym in user_input: #якщо тут англійська буква
  5.         if ('+' in user_input) or ('-' in user_input) or ('*' in user_input) or ('/' in user_input): #якщо тут є математичний знак
  6.             print('Це вираз з буквами')
  7.             exit(1)
  8.         else:
  9.             print('Це рядок на латині')
  10.             exit(1)
  11. ukr = 'абвгдеєжзийклмнопрстуфхцчшщьюя'
  12. for sym in ukr:
  13.     if sym in user_input:
  14.         if ('і' in user_input) or ('є' in user_input) or ('ґ' in user_input) or ('ї' in user_input):
  15.             print('Це рядок на українській мові')
  16.             exit(1)
  17.         elif ('ы' in user_input) or ('э' in user_input) or ('ъ' in user_input):
  18.             print('Це рядок на російській мові')
  19.             exit(1)
  20.         else:
  21.             print('Це рядок на кирилиці')
  22.             exit(1)
  23. if ('.' in user_input) or (',' in user_input):
  24.     print('Це неціле число')
  25.     exit(1)
  26. else:
  27.     print('Це ціле число')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement