Skip to content

Conversation

@BohdanC
Copy link

@BohdanC BohdanC commented Dec 23, 2019

No description provided.

import re
s=input()
a=re.findall(r'\d+',s)

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

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

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(" ")

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Використовуй пробіли, набагато комфортніше читати код.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants