-
Notifications
You must be signed in to change notification settings - Fork 51
ready_to_review #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ready_to_review #59
Conversation
|
|
||
| def res_func(str_1): | ||
| """checking the input string""" | ||
| if bool(re.match('^[begin ]{1,2}[writeln() ]+[end]{1,2}$', str_1)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Регулярний вираз не коректний для даної задачі, потрібно замінити на (^(begin begin)(( begin)( readln()| writeln())( begin){0,1}( end){0,1}( readln()| writeln())( end))*$)
| @@ -0,0 +1,19 @@ | |||
| import re | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Недоречно імпортувати цілу бібліотеку, краще замінити на from re import match
| print('YES') | ||
| else: | ||
| print('NO') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Краще повертати змінну типу bool , для підвищення універсальності функції.
| вираз записується без використання пробільних символів | ||
| ''' | ||
|
|
||
| def res_func(str_1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для кращої читабельності коду функції варто назвати validator
| початковому списку. | ||
| ''' | ||
|
|
||
| list_1 = ['jdsf', 'jkldsf', 174268, 325, True, [], '12', []] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Варто список назвати main_list
|
|
||
| list_1 = ['jdsf', 'jkldsf', 174268, 325, True, [], '12', []] | ||
|
|
||
| print(list_1.count([])) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нагромаджування виклику функцій . Для підвищення читабільності варто розбити на кілька змінних .
| Дано довільний рядок, що є реченням. Вивести кожне 3 слово в цьому реченні. | ||
| """ | ||
|
|
||
| text_1 = 'Найбілишим містом України і одночасно столицею країни є Київ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Назву text_1 варто замінити на line для більшї читабельності коду
| """ | ||
|
|
||
| text_1 = 'Найбілишим містом України і одночасно столицею країни є Київ' | ||
| list_sentence = text_1.split() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не зовсім зрозуміла назва list_sentence, краще замінити на list_word
| num_1 = int(input('Пепрше число: ')) | ||
| num_2 = int(input('Друге число: ')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Немає перевірки на тип данних, які вводяться з клавіатури, що може призвести до помилки ValueError
No description provided.