-
Notifications
You must be signed in to change notification settings - Fork 51
codereview #54
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?
codereview #54
Conversation
| import re | ||
| s=input() | ||
| a=re.findall(r'\d+',s) | ||
|
|
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.
Для початку, треба давати гарні ім'я для змінних, оскільки це спрощує читання коду s краще замінити хоча б на string.По-друге, краще створювати окрему змінну для шаблону і знову ж загально прийнятим ім'ям для шаблону є pattern, рекомендую використовувати його.
|
|
||
| for i in a: | ||
| c=convert_base(i) | ||
| print(c) 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.
Код написаний гарно і логічно, але в очі кидається відсутність пробілів, раджу привчати себе до них.
|
|
||
| list=[1,3,555,[],134,'fjwlijc',[],'random'] | ||
| LS=list.count([]) | ||
| print("Кількість порожніх списків="+str(LS)) 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.
Код написаний гарно і коротко , але раджу не забувати про пробіли.
| Вивести усі слова котрі містять в слові велику букву | ||
| """ | ||
| A=input("Введіть рядок:") | ||
| slova = A.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.
"A" , це не коректне ім'я для змінної.
| for i in list: | ||
| if isinstance(i,int): | ||
| sum+=i | ||
| print(sum) 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.
Використовуй пробіли, набагато комфортніше читати код.
No description provided.