Skip to content

Conversation

@ilyasnoskov
Copy link

No description provided.

Comment on lines +1 to +17
"""
Знайти мінімальне слово за кількістю букв.
"""

import re


text=input()
def find_text(text):

a = re.findall('\w*[A-Za-z]', text)
for element in a:
min(b) = int(len(element))

return print(min)

find_text(text) 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.

This code doesn't work. This program should be written like this (in two strings):
'''
import re
print(min((x for x in re.findall(r'\w*[A-Za-z]', input())),key=len))
'''
There are wrong names of variables and syntaxes.
For example, name 'a' can be named as min_text, variable 'b' is not found in code, function min() is used incorrectly.
You need to make spaces before and after '=' for more readability.

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