-
Notifications
You must be signed in to change notification settings - Fork 51
ready to review #48
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 #48
Conversation
| Підрахувати кількість порожніх листів | ||
| """ | ||
| rand_list = ["asdasd", 1231, 1251.1001, [], [123, 123, "ASD"], "KSAJFKJO1", "1234124", [123, 321], [], [], 123, 123.123, [], [123]] | ||
| counter = 0 |
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.
Зроблено за допомогою функцій
`
def empty_lists(list_1):
counter = 0
for element in list_1:
if isinstance(element, list) is True and len(element) == 0:
counter += 1
return int(counter)
print("Count of empty lists: ", empty_lists(rand_list))
`
| return result_str | ||
|
|
||
| def day_counter(user_list): | ||
| day_list = ["Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"] |
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.
Дні тижня слід писати українською мовою
| """ | ||
| Вивести усі слова, що містять цифру 9 | ||
| """ | ||
| rand_text = "Adp9slp spldpsldpsl sdlpsldp sa9d aspdl as asldp asdpl asdlp a a9 a apsdl asd asdsap asd asdqwe qwe qweqw9rtfas qwrqawsfqwfxaf qpwl9dpsa" |
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.
Зроблено за допомогою функцій
`rand_text = "Adp9slp spldpsldpsl sdlpsldp sa9d aspdl as asldp asdpl asdlp a a9 a apsdl asd asdsap asd asdqwe qwe qweqw9rtfas qwrqawsfqwfxaf qpwl9dpsa"
def if_word_9(text):
rand_list = text.split()
result_str = ""
for word in rand_list:
counter = False
for letter in word:
if letter == "9":
counter = True
if counter is True:
result_str += word + " "
# print(word, end=" ")
else:
continue
return result_str
print(if_word_9(rand_text))`
|
|
||
| def day_counter(user_list): | ||
| day_list = ["Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"] | ||
| sum_of_days = (int(user_list[2])*365) + (int(user_list[1])*31) + int(user_list[0]) |
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.
Не вистачає обробки високосного року.
`
if int(user_list[2]) % 4 == 0:
sum_of_days = (int(user_list[2])*365) + (int(user_list[1])*31) + (int(user_list[0])) + (int(user_list[2])//4)
res = day_list[(sum_of_days % 7)]
elif int(user_list[2]) % 4 != 0:
sum_of_days = (int(user_list[2]) * 365) + (int(user_list[1]) * 31) + int(user_list[0])
res = day_list[(sum_of_days % 7)-1]
return res
`
| first_num = float(input("Enter the first number:")) | ||
| second_num = float(input("Enter the second number:")) | ||
|
|
||
| for num in range(int(first_num), int(second_num)+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.
Зроблено за допомогою функцій
`
def numb(start,end):
for num in range(int(start), int(end)+1):
if num % 3 == 0:
print(num)
else:
continue
print(numb(first_num,second_num))
`
No description provided.