17
tkachuk.constantine
2 13 28
1493/ 1695
Kostiantyn Tkachuk
Last seen 1 year ago
Member for 3 years, 1 month
Difficulty Normal
Missions (95) / Solutions (82)
Best solutions / Newest solutions
Initiation
Methods like append, insert, remove or sort that only modify the list have no return value printed – they return the default None. 1 This is a design principle for all mutable data structures in Python. Reference: docs.python.org
Replace First
pop
typing.Iterable
Iterable
typing
append
6
Implementing what I saw in previuos tasks
End Zeros
inline-if
int
if
16
4
string partion() is convinienet
Between Markers (simplified)
partition
str
1
int(max(str(number)))
Max Digit
max
int
str
2
Simple and readable. Used someting i learnt form previous tasks solved by clever guys.
Remove All Before
index
typing.Iterable
Iterable
typing
count
I love recursion
Beginning Zeros
startswith
inline-if
int
str
1
One line with re module and search()
All Upper I
re.search
search
re
bool
inline-if
46 symbols all() map() lambda
All the Same
Any
typing.Any
all
List
typing.List
Weird solution :), hope it is efficent when incoming set is huge
Nearest Value
min
abs
set
sorted
while
re with findall() works
Count Digits
findall
re.findall
re
int
str
Readable logic
Split Pairs
pop
break
while
append
list
just slicing
Correct Sentence
upper
inline-if
str
Home
1.5 lines. Using what I learnt from checkio.org :)
Morse Decoder
capitalize
map
lambda
join
list-comp
12
3
Simplicity and Readability
Three Words
isalpha
bool
False
True
split
1
one line with find() and count()
Second Index
find
None
count
inline-if
int
1
Inventing wheel
Backward Each Word
isspace
reversed
join
list
else
1.5 lines just to keep readibility
Split List
inline-if
list
len
if time in range(600, 1801)
Sun Angle
replace
inline-if
in
range
int
just for loop - the only benefit is readibility :)
Popular Words
dict-comp
dict
lower
in
split
7 lines with brief comments
Sort Array by Element Frequency
keys
lambda
sorted
in
append
1
nothing special
Days Between
date
datetime.date
datetime
abs
1
62 symbols :)
Bigger Price
lambda
sorted
True
list
int
my first lamda functions inside
Between Markers
index
lambda
inline-if
in
and
2
Clear but 17 lines :) with comments
Pawn Brotherhood
collections.namedtuple
namedtuple
collections
ord
set
Hope there is an easier solution :)
First Word
re.search
search
lstrip
re
split
pop() and append()
Non-unique Elements
pop
in
append
range
list
2
Electronic Station
4 lines with detailed explanation
Sort by Extension
rfind
List
typing.List
pop
index
20
57 symbols
Ascending List
typing.Iterable
Iterable
bool
set
typing
1
intensively increased readibility :)
Acceptable Password VI
strip
all
any
isdigit
bool
1
long one line :)
Acceptable Password IV
isnumeric
strip
re.search
search
re
1
improved readibilty :)
Acceptable Password V
strip
all
any
isdigit
bool
For loop + re.search
Words Order
re.search
search
re
None
break
3
re.search('\d', password)
Acceptable Password II
re.search
search
re
bool
inline-if
1
not not search('\d', password) with comments
Acceptable Password III
isnumeric
re.search
search
re
bool
1
upper() strip() isdecimal()
All Upper II
isdecimal
strip
upper
bool
not
1
Comments everywhere :)) 5 small sub functions; 10 lines of code for the main block
Similar Triangles
Tuple
typing.Tuple
math.acos
acos
copy
2
10 short lines; just built-in functions; and lots of comments :)
Brackets
rfind
reversed
keys
all
items
2 lines
Surjection Strings
all
bool
count
inline-if
False
1
remove(), append(), replace() is mighty toolset :)))
Verify Anagrams
remove
replace
bool
not
lower
just built-in functions. Comments and explanations :))
Find Sequence
any
List
typing.List
bool
typing
one line with reduce(), lambda, int(), str(),
Digits Multiplication
functools.reduce
reduce
functools
lambda
inline-if
mapping functions is cool :)
Boolean Algebra
not
lambda
or
and
Scientific Expedition
1 line with sum() and join()
Sum by Type
Tuple
typing.Tuple
type
isinstance
is
highly readible plus 'walrus' operator. Easy, but for some reasons taking long time :))
Goes Right After
index
bool
or
False
str
Aaaaaa ...... 16 lines :)). Commetns for each block.
The Hidden Word
ljust
splitlines
re.search
search
tuple
Several lines with per-line comments. I like the task:)))
Striped Words
punctuation
string.punctuation
strip
string
upper
1
swapcase() and caps_flag
Caps Lock
swapcase
ascii_lowercase
string.ascii_lowercase
string
continue
one line, 105 symbols; agree - a bit lengthy :)))
Conversion from CamelCase
islower
lower
inline-if
join
comprehension
old way, most probaly not pythonic way, however it still works :)
Bird Language
while
in
elif
else
len
Readible like a book :)))
Follow Instructions
Tuple
typing.Tuple
typing
lower
int
2 lines; nothing special, but it works :)))
Conversion into CamelCase
upper
enumerate
replace
inline-if
join
Highly readible, Weird solution with lower(), lstrip(), and '.' :))
Time Converter (24h to 12h)
datetime.strptime
strptime
datetime.datetime
datetime
lstrip
2
most ordinary, higly readable solution :))
Letter Queue
startswith
List
typing.List
pop
replace
First
I Love Python!
1
sorted with key parametr
Absolute Sorting
tuple
abs
sorted
list
1
nothing special plus set_monster :))
Pangram
ascii_lowercase
string.ascii_lowercase
string
set
lower
2
82 symbols of highly readible code :))
Common Words
sorted
join
if-comprehension
in
list-comp
2
min and max, plus text_monster is presented :))
The Most Wanted Letter
values
dict-comp
isalpha
min
set
O'Reilly
25 symbols :)
Majority
bool
sum
list
len
1
insert() and pop()
Replace Last
insert
pop
inline-if
list
len
2
60 symbols
Remove All After
index
typing.Iterable
Iterable
typing
inline-if
love walrus operator
Chunk
typing.Iterable
Iterable
typing
while
append
1
-math.inf :)) just to start, plus extend() and slicing
Reverse Every Ascending
math.inf
inf
extend
math
continue
few lines with comments
Lightbulb Start Watching
repr
Optional
typing.Optional
insert
filter
Detailed Comments. 15 lines :)))
Lightbulb End Watching
datetime.now
now
repr
Optional
typing.Optional
58 symbols with lst.append('blabla') :)))
Compress List
typing.Iterable
Iterable
typing
if-comprehension
append
Comments. Nothing excluisve :)))
Time Converter (12h to 24h)
datetime.replace
datetime.time
datetime.strftime
strftime
time
10 lines ....AAAAaaa....must be better solution :)
How Deep
isinstance
tuple
max
inline-if
list-comp
one line, 94 symbols, not easily readible :)
Lightbulb Intro
repr
datetime.datetime
float
datetime
List
2
2 approaches: 1 - one line solution 2 - readable version, I call it human version :))
Median of Three
enumerate
typing.Iterable
Iterable
typing
inline-if
4 lines with builtins
Sort Except Zero
insert
remove
enumerate
typing.Iterable
Iterable
Recursion without additional function plus arithmetics with lists :))
Flatten a List
isinstance
append
else
int
for
super readible 3 lines :)
Median
float
List
typing.List
typing
inline-if
1
another First
Index Power
inline-if
and
list
int
len
Incinerator
20-25 methods - just to try :)))
Army Battles
BaseException
class
raise
property
decorator
nothing special
The Warriors
class
bool
while
False
and
Mine
super readible 3 lines :) with comments
Cut Sentence
rfind
rstrip
inline-if
len
if
1
COOL task!!! Weird_sort(), recursion, reduce(), add(). Comments. Lots of happiness passing verification :))
Bigger Together
cmp_to_key
functools.cmp_to_key
operator.add
operator
functools.reduce
54 symbols with detailed comments :))
Best Stock
dict
items
lambda
sorted
list
1
2 if only :))
Fizz Buzz
strip
not
inline-if
int
str
Ice Base
46 symbols :)
The Most Numbers
min
max
inline-if
len
1
GitHub
1 line - Double any; double list comprehension
The End of Other
any
if-comprehension
and
True
list-comp