Terminology
salary - жалақы - зарплата
destination - тағайындалған
орын
- место назначения
to
differ - басқаша - отличаться
to
arrange - ұйымдастыру - организовать
rook
- ладья - ладья
ascending - өсу бойынша - по возрастанию
Practice 1
Salary
There are 3 epmloyees in a company. Their job salaries
differ and the company’s CEO wants to make them equal. Let us write
a code that calculates difference between the highest and lowest
salaries.
a,b,c=map(int,input().split())
if
a>b and a>c:
m=a
elif
b>a and b>c:
m=b
else:
m=c
if
a<b and a<c:
n=a
elif
b<a and b<c:
n=b
else:
n=c
print(m-n)
Practice 2
Chess
Master - Rook Zhansaya is a multiple winner of many chess
competitions worldwide. Nevertheless, she did not become a chess
player immediately. She was also studying hard how to play this
game. Zhansaya was not afraid of making mistakes because she knew
that practising makes her better. Now we want to know how she was
learning to play with a rook. As you know, the rook moves
horizontally or vertically on the chessboard. The initial position
of the rook (letter, number) is shown on the picture. The rook has
to reach the destination point (letter, number) in one
move.
m=input()
m1=int(input())
n=input()
n1=int(input())
if
m==n or m1==n1:
print("yes")
else:
print("no")
Practice 3
Hypotenuse
rule
Write a code that checks if the given hypotenuse is correct or not.
Hypotenuse rule: (Longest sides)2 = (Side one)2 + (Side
two)2.
a=int(input())
b=int(input())
c=int(input())
if
a*a==b*b+c*c or b*b==a*a+c*c or c*c==a*a+b*b:
print("yes")
else:
print("no")
Practice 4
Even or Odd
Кіріске үш натурал сан
(a, b, c) еңгізілген. Бір уақытта кем дегенде бір жұп және бір тақ
бар-жоғын тексеріңіз. Егер осы шарт дұрыс болса «YES», болмаса «NO» сөзін
экранға шығарыңыз.
a,b,c=map(int,input().split())
if
(a%2==0 or b%2==0 or c%2==0) and(a%2==1 or b%2==1 or c%2==1)
:
print("yes")
else:
print("no")
|