Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions starenchenkonv/first/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
new_list = [1,2,4,5.1,5.5,6,7.7,67.6,453.6,4356.56,5645.6]
Copy link

Choose a reason for hiding this comment

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

new_list = [1,2,4,5.1,5.5,6,7.7,67.6,453.6,4356.56,5645.6]
float_list = []

def get_floats_len(float_list, new_list):
for index in new_list:
if isinstance(index, float):
float_list.append(index)
print(len(float_list))
return len(float_list)

get_floats_len(float_list, new_list)

float_list = []

for index in new_list:
if isinstance(index ,float):
float_list.append(index)

print(len(float_list))
7 changes: 7 additions & 0 deletions starenchenkonv/first/task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
text = "hello my Name Is Nazar"

text_list = text.split()

for word in text_list:
if word[0].isupper():
print(word)
Copy link

Choose a reason for hiding this comment

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

text = "hello my Name Is Nazar"

def get_all_upper_starts_words(text):
words_list = []
text_list = text.split()
for word in text_list:
if word[0].isupper():
words_list.append(word)
print(word)
return words_list

get_all_upper_starts_words(text)

11 changes: 11 additions & 0 deletions starenchenkonv/first/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
num_1 = float(input("type number: "))
num_2 = float(input("type number: "))
counter = 1
num_1_int = int(num_1)
num_2_int = int(num_2)

for index in range(num_1_int, num_2_int + 1):
if index > 0:
counter = counter * index

print(counter)
Copy link

Choose a reason for hiding this comment

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

num_1 = float(input("1 number: "))
num_2 = float(input("2 number: "))
counter = 1
num_1_int = int(num_1)
num_2_int = int(num_2)

for number in range(num_1_int, num_2_int + 1):
if number > 0:
counter = counter * number

print(counter)

34 changes: 34 additions & 0 deletions starenchenkonv/second/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import re

def is_date(date):
return bool(re.match(r"\d{2}[-]\d{2}[-]\d+", date))

date = input("enter date: ")
while not is_date(date):
date = input("enter date: ")

day_list = ["Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота", "Неділя"]

date_list = date.split("-")

for index in range(len(date_list)):

date_list[index] = int(date_list[index])


def main(date_list):
if date_list[0] > 30 or date_list[1] > 12 or date_list[2] < 1:

print("error")
else:
if date_list[2] % 4 == 0:
#рік високосний
high_years = date_list[2] / 4 #кількість високосних років
else:
#рік не високосний
pass



main(date_list)

Copy link

Choose a reason for hiding this comment

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

программа не закінчена