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
87 changes: 87 additions & 0 deletions students/km62/Antonov_Myxajlo/homework_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#task1------------------------------------------------------------
���
�������� ��������, ��� ������ ��� ����� � ����� �� ����. ����� ����� ���������� ������� � �������� �����.

���
#a=float(input("������ �����:"))
b=float(input("������ �����:"))
c=float (input("������ �����:"))
print("�����:",a+b+c)
#-----------------------------------------------------------------


#task2------------------------------------------------------------
���
�������� ��������, ��� ������ ������� ���� ������ ������������ ���������� �� �������� ���� �����. ���������� ������� ������� ������ � ������� ������.

���
#a=float(input("������ �����:"))
b=float(input("������ �����:"))
print(a*b*1/2)
#-----------------------------------------------------------------


#task3------------------------------------------------------------
���
N �������� �������� K ����� � ���������� �� �� ����� ������. ��������� ������ ���������� � ������. ������ ����� ������ ����� �������? ������ ����� ���������� � ������?
�������� ������ ����� N � K. ���� ������� ������� ��� �����: ������ �� ���������� ���� �������.

���
#N=int(input("�-���� �����:"))
K=int(input("�-���� ���������:"))
print("�-���� ����� � ��������:",N//K)
print("�-���� ����� � �������:",N%K)
#-----------------------------------------------------------------


#task4------------------------------------------------------------
���
����� ����� N - ������� ������, ����������� ���� ������. ������ ����� � ������ ���� ���������� �������� ��������, ���� �� ���� ����� 00:00?
�������� ������� �������� ��� �����: ������� ����� (�� 0 �� 23) � ������� ������ (�� 0 �� 59). ³����� �� �����, �� ��������� � ������ ���� ������ ������� ����, ���� ����� N ���� ���� ��������� �������.

���
#N=int(input("�-���� �����:"))
b=N//60
c=N%60
print("����:",b)
print("������:",c)
#-----------------------------------------------------------------


#task5------------------------------------------------------------
���
�������� ��������, ��� ��� �����������, �������� ����� "Hello", ��'� ����������� � ���� ������ ���� �����. ��������� �Hello, Mike!�

���
#name=input("your name:")
print("Hello,",name,"!")
#-----------------------------------------------------------------


#task6------------------------------------------------------------
���
�������� ��������, ��� ����� ���� ����� � ����� ���� ��������� � �������� �������� �� ��������:
The next number for the number 179 is 180.
The previous number for the number 179 is 178.

���
#a=input("������� �����:")
print("The next number for the number",a,int(a)+1)
print("The previous number for the number",a,int(a)-1)
#-----------------------------------------------------------------


#task7------------------------------------------------------------
���
����� ������� ���������� ��� ��� ����� ����� �� ������ �� ����� �����. � ������� ���� ��������� ���������� ����� ��� �����, � ����������, �� �� ����� ������ ���� ����� �� ����� ���� �����. ��� ��������� ������� ����� ��������� ��������?

���
#a=int(input("������ ������"))
b=int(input("������ ������"))
c=int(input("������ ������"))
d=a//2+a%2
f=b//2+b%2
e=c//2+c%2
print(d+f+e)
#-----------------------------------------------------------------

214 changes: 214 additions & 0 deletions students/km62/Antonov_Myxajlo/homework_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
#task1------------------------------------------------------------
���
���� ��� ����� �����. ������� �������� � ���.
���
#a=int(input("First number:"))
b=int(input("Secound number:"))
if a<b:
print(a)
elif a>b:
print(b)
else:
print("none")
#-----------------------------------------------------------------


#task2------------------------------------------------------------
���
������� ��������� �������sign(x), �� ����������� ��������� �����:
sign(x) = 1, if x > 0,
sign(x) = -1, if x < 0,
sign(x) = 0, if x = 0.

���
#x=float(input("Enter number:"))
if x>0:
print("sign(x) = 1")
elif x<0:
print("sign(x) = -1")
else:
print("sign(x) = 0")
#-----------------------------------------------------------------


#task3------------------------------------------------------------
���
���� ��� ����� �����. ������� �������� � ���.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
if a<b and a<c:
print(a)
elif b<c and b<a:
print(b)
elif c<b and c<a:
print(c)
else:
print("a=b=c")
#-----------------------------------------------------------------


#task4------------------------------------------------------------
���
���� ���� �����, �� ������� ��. ���������, �� � �������� �� ����������. ���� ���, �� ������� ����������� "LEAP", � ������ ������� � "�OMMON".
г� ����������, ���� ���������� ���� � ���� � ����:
��� ������ ����������, ���� ���� ����� ������� �� 4 ��� ������ � �� ������� ��� ������ �� 100
��� ������ ����������, ���� ���� ����� ������� �� 400 ��� ������

���
#a=int(input("Enter the year:"))
b=a%4
c=a%100
d=a%400
if b==0 and c!=0:
print("LEAP")
elif d==0:
print("LEAP")
else:
print("�OMMON")
#-----------------------------------------------------------------


#task5------------------------------------------------------------
���
���� ��� ����� �����. ��������, ������ � ��� ��������� ���� ������. �������� ������� �������� ���� � �����: 3 (���� �� ����� �������), 2 (���� ��� � ��� ��������� ���� ������, � ���� �����������) ��� 0 (���� �� ����� ����).

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
if a!=b and a!=c and c!=b:
print(0)
elif b!=c or a!=b or a!=c:
print(2)
else:
print(3)
#-----------------------------------------------------------------


#task6------------------------------------------------------------
���
������ ���� ����������� �� ���������� ��� �� ��������. ���� ���������� ���� ����� ������ �����. ���������, �� ���� ���� ������� � ����� ������ � ����� �� ���� ���. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ���� ���� �������� ����������, ��� "NO" � ������ �������.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
if (a not in x or b not in x or c not in x or z not in x):
print("Inccorect input")
elif (a==c or b==z):
print("YES")
else:
print("NO")
#-----------------------------------------------------------------


#task7------------------------------------------------------------
���
���� ���������� ���� ����� ������ �����. ���������, �� ���������� ���� �������. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ���� ���������, ��� "NO" � ������ �������.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
line=list(range(1,9,2))
line2=list(range(2,9,2))
if (a not in x or b not in x or c not in x or z not in x):
print("Inccorect input")
elif (a in line and b in line and c in line and z in line):
print("YES")
elif (a==b and c==z):
print("YES")
elif (a in line2 and b in line2 and c in line2 and z in line2):
print("YES")
else:
print("NO")
#-----------------------------------------------------------------


#task8------------------------------------------------------------
���
������� ������ ����������� �� ����������, �� �������� ��� �� ������� �� ����-��� ������ �������. ���� ���������� ���� ����� ������ �����. ���������, �� ���� ������ ������� � ����� ������ � ����� �� ���� ���. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ��� ��������, ��� "NO" � ������ �������.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
if (a not in x or b not in x or c not in x or z not in x):
rint("Inccorect input")
elif ((a+1)==c and b==z) or ((b+1)==z and a==c):
print("YES")
elif ((a+1)==c ) and ((b+1)==z):
print("YES")
else:
print("NO")
#-----------------------------------------------------------------


#task9------------------------------------------------------------
���
������� ���� �������� �� ������� �� ����-��� ������� �����. ���� ���������� ���� ����� ������ �����. ���������, �� ���� ���� ������� � ����� ������ � ����� �� ���� ���. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ��� ��������, ��� "NO" � ������ �������.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
�=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
if (a not in x or b not in x or c not in x or z not in x):
print("Inccorect input")
elif (a+z==b+c) or (a+b==c+z):
print("YES")
else:
print("NO")
#-----------------------------------------------------------------


#task10------------------------------------------------------------
���
������ �������� �������� �� ����������, �� �������� ��� �� ������� �� ����-��� ������� �����. ���� ���������� ���� ����� ������ �����. ���������, �� ���� �������� ������� � ����� ������ � ����� �� ���� ���. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ��� ��������, ��� "NO" � ������ �������.

���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
if (a not in x or b not in x or c not in x or z not in x):
print("Inccorect input")
elif (a==c or b==z):
print("YES")
elif (a+z==b+c) or (a+b==c+z):
print("YES")
else:
print("NO")

#-----------------------------------------------------------------


#task11------------------------------------------------------------
���
������� ��� �������� �� ����� L. ³� ���� ����������� �� �� ������� �� ���������� � ���� ������� �� �������� ��� �� �� ������� �� �������� � ���� �� ����������. ���� ���������� ���� ����� ������ �����. ���������, �� ���� ��� ������� � ����� ������ � ����� �� ���� ���. ���������� ������� ������ ����� ����� �� 1 �� 8, ����� � ���� ������� ����� ����� �� ��������� ������. ����� ��� ����� - ��� ����� ������, ������� ��� ����� � ��� �����. �������� �� ������� "YES", ���� ��� ��������, ��� "NO" � ������ �������.
���
#a=int(input("First number:"))
b=int(input("Secound number:"))
c=int(input("Third number:"))
z=int(input("Fourth number:"))
x=list(range(1,9))
if (a not in x or b not in x or c not in x or z not in x):
print("Inccorect input")
elif ((a-c)==2 and (b-z)==-1) or ((a-c)==-2 and (b-z)==1) or ((a-c)==2 and (b-z)==-1) or ((a-c)==-2 and (b-z)==-1):
print("YES")
elif (a-c==-1 and b-z==2) or (a-c==1 and b-z==2) or (a-c==1 and b-z==-2) or (a-c==-1 and b-z==-2):
print("YES")
else:
print("NO")
#-----------------------------------------------------------------
Binary file added students/km62/Antonov_Myxajlo/homework_3.py
Binary file not shown.
Binary file added students/km62/Antonov_Myxajlo/homework_4.py
Binary file not shown.
Loading