Презентация "Problem solving: Conditional statements and logical operators" 8 сынып
Дипломдар мен сертификаттарды алып үлгеріңіз!
1 слайд
Problem solving:
Conditional
statements and
logical operators
1 слайд
Problem solving: Conditional statements and logical operators
2 слайд
Recall past knowledge
Өткен білімді еске
түсірейік
2 слайд
Recall past knowledge Өткен білімді еске түсірейік
3 слайд
Examples :
if 1:
print("hello 1")
will print :
a = 3
if a == 3:
print("hello 2") a = 3
if a > 1:
print ( "hello 3" )
will print :
will print :
3 слайд
Examples : if 1: print("hello 1") will print : a = 3 if a == 3: print("hello 2") a = 3 if a > 1: print ( "hello 3" ) will print : will print :
4 слайд
Examples :
a = 3
if a > 2 :
print ( "H" )
else :
print ( "L" )
will print :
a = 1
if a > 2 :
print ( "H" )
else :
print ( "L" )
will print :
4 слайд
Examples : a = 3 if a > 2 : print ( "H" ) else : print ( "L" ) will print : a = 1 if a > 2 : print ( "H" ) else : print ( "L" ) will print :
5 слайд
х = i n t (i n p u t (" Enter the number : "))
if х % 2 = = 0:
p r i n t (х, "- even number ")
else:
p r i n t (х, " - odd number ")
5 слайд
х = i n t (i n p u t (" Enter the number : ")) if х % 2 = = 0: p r i n t (х, "- even number ") else: p r i n t (х, " - odd number ")
6 слайд
print ( ‘ Program for enrolling in the Python programming
group ')
age = int(input(" Enter your age :"))
if 10<= age <= 14:
print(" You can join the Python Programming Group ")
else:
print (" You don't suit us !")
6 слайд
print ( ‘ Program for enrolling in the Python programming group ') age = int(input(" Enter your age :")) if 10<= age <= 14: print(" You can join the Python Programming Group ") else: print (" You don't suit us !")
7 слайд
Examples :
a = int (input( " Enter the number :" ))
if a < 0 :
print( " negative number " )
elif a == 0 :
print( " Equals 0 " )
else :
print( " positive number " )
7 слайд
Examples : a = int (input( " Enter the number :" )) if a < 0 : print( " negative number " ) elif a == 0 : print( " Equals 0 " ) else : print( " positive number " )
8 слайд
print (""" What operating system are you using?
1 — Windows 10
2 — Windows 8.1
3 — Windows 8
4 — Windows 7
5 — Windows Vista
6 - Other """)
os = int(input (" Enter the number corresponding to the answer: "))
if os == 1:
print (" You choosed : Windows 10")
elif os == 2 :
print (" You choosed : Windows 8.1")
elif os == 3:
print (" You choosed : Windows 8")
elif os == 4:
print (" You choosed : Windows 7")
elif os == 5:
print (" You choosed : Windows Vista")
elif os == 6:
print (" You choosed : another ")
elif not os:
print (" You choosed ")
else:
print (" We were unable to detect your operating system ")
8 слайд
print (""" What operating system are you using? 1 — Windows 10 2 — Windows 8.1 3 — Windows 8 4 — Windows 7 5 — Windows Vista 6 - Other """) os = int(input (" Enter the number corresponding to the answer: ")) if os == 1: print (" You choosed : Windows 10") elif os == 2 : print (" You choosed : Windows 8.1") elif os == 3: print (" You choosed : Windows 8") elif os == 4: print (" You choosed : Windows 7") elif os == 5: print (" You choosed : Windows Vista") elif os == 6: print (" You choosed : another ") elif not os: print (" You choosed ") else: print (" We were unable to detect your operating system ")
9 слайд
Let's check the
homework7 is an incredible number! Input: two
integers. Output: print “True” if one of
the numbers is 7 or their difference or
sum is equal to 7. Otherwise print
“False”.
Write a program and block diagram
9 слайд
Let's check the homework7 is an incredible number! Input: two integers. Output: print “True” if one of the numbers is 7 or their difference or sum is equal to 7. Otherwise print “False”. Write a program and block diagram
10 слайд
Terminology
salary - жалақы - зарплата
destination – тағайындалған орын
- место назначения
to differ - басқаша - отличаться
to arrange - ұйымдастыру -
организовать
rook - ладья - ладья
ascending - өсу бойынша - по
возрастанию
10 слайд
Terminology salary - жалақы - зарплата destination – тағайындалған орын - место назначения to differ - басқаша - отличаться to arrange - ұйымдастыру - организовать rook - ладья - ладья ascending - өсу бойынша - по возрастанию
11 слайд
salary - жалақы - зарплатаsalary.mp3
11 слайд
salary - жалақы - зарплатаsalary.mp3
12 слайд
destination - тағайындалған
орын - место назначения
12 слайд
destination - тағайындалған орын - место назначения
13 слайд
to differ - басқаша - отличаться
13 слайд
to differ - басқаша - отличаться
14 слайд
to arrange - ұйымдастыру -
организовать
14 слайд
to arrange - ұйымдастыру - организовать
15 слайд
rook - ладья - ладья
15 слайд
rook - ладья - ладья
16 слайд
ascending - өсу бойынша - по
возрастанию
16 слайд
ascending - өсу бойынша - по возрастанию
17 слайд
And now let's do some practical
work
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.
17 слайд
And now let's do some practical work 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.
18 слайд
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.
18 слайд
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.
19 слайд
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.
19 слайд
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.
20 слайд
Practice 4
Even or Odd
Кіріске үш натурал сан (a, b, c) еңгізілген .
Бір уақытта кем дегенде бір жұп және бір
тақ бар - жоғын тексеріңіз . Егер осы шарт
дұрыс болса «YES», болмаса «NO» сөзін
экранға шығарыңыз .
20 слайд
Practice 4 Even or Odd Кіріске үш натурал сан (a, b, c) еңгізілген . Бір уақытта кем дегенде бір жұп және бір тақ бар - жоғын тексеріңіз . Егер осы шарт дұрыс болса «YES», болмаса «NO» сөзін экранға шығарыңыз .
21 слайд
Home task : § 3.9
Make a program in
Python Practice 5
21 слайд
Home task : § 3.9 Make a program in Python Practice 5