Курс повышения квалификации
Курс профессиональной переподготовки
Курс повышения квалификации
Видеолекция
1 слайд
Theme of the lesson 4.2 PROBLEM SOLVING: FOR LOOP
Lesson objectives:
- apply ‘FOR’ Loop.
2 слайд
. Check and analysis of homework
Homework set in the last lesson:
Write programs:
1) With the help of a loop, output a repeating line from any song 25 times.
2) Write a program that receives two integers A and B (0 <A <B) and displays the squares of all natural numbers in the interval from A to B.
3 слайд
Activity
Eldar uses a controller with a circuit to light 16 LED lamps which are labeled from 1 to 16. When the controller a gives signal to a LED lamp, it changes its state (ON or OFF). In the beginning, all the LEDs are switched OFF. Eldar has found a sequence of lightning: On the 1st second controller lights ON all LED lamps. (1….2….3….) On the 2nd it lights ON the LEDs that are even in the circuit. (2...4...6….) On 3rd second it lights every third LED in the circuit. (3...6...9…) And so it continues in similar way... Which LEDs must be switched ON after the 16th second?
100 tenge There are (N) number of coins on table. Some of them are tails, and some are heads. How many coins do we need to turn around so that all coins be of the same side? We have total number of coins (N). Next N rows contain the numbers 1 (if a coin is up tail) or 0 (if a coin is up head). Find the minimum number of coins that you must turn. Input: The first line is a total number of coins, next lines are values of tails or head. tails = 1, head = 0 Output: Minimum number of coins that we must turn.
4 слайд
Resolution
n=int(input())
for i in range (n):
x=int(input())
if x==0:
s=s+1
print(s)
5 слайд
Terminology
divisor - бөлгіш - делитель
controller - тексеруші – контролер
head - тиынның сыртқы беті - орел
circuit - тізбек - цепь
independence - тәуелсіздік - независимость ascending - өсу - восходящий
ancestor - арғы ата - предок
particularly - атап айтқанда - в частности
LED - жарық диодты индикатор - светодиод independent - тәуелсіз - независимый
6 слайд
Work on computers
Practice 1
Exercises
Bakhtiyar likes to do morning exercises. He knows that it makes him feel better and healthier. Also he wants to count time that he spends for exercises everyday. Can you help him?
7 слайд
Resolution
s=0
n=int(input())
for i in range (n):
x=int(input())
s=s+x
print(s)
8 слайд
Practice 2
Positive numbers
Print all positive divisors of X from 1 to itself in ascending order
9 слайд
Resolution
x=int(input())
for i in range (1,x+1,1):
if x%i==0:
print(i)
10 слайд
Practice 4
Positive, negative or zero?
You have N amount of numbers. Defi ne which of the N numbers are zero, positive or negative numbers. Print total count of zeros, then positive numbers and finally negative numbers.
11 слайд
Resolution
12 слайд
Homework
Write programs:
1) Using the for loop, print all even numbers from 10 to 20.
2) Using the for loop, print the first 10 powers of two.
3) 7 natural numbers are entered from the keyboard. Print the largest of them.
13 слайд
6 281 165 материалов в базе
«Информатика», Босова Л.Л., Босова А.Ю.
3.4.1. Условный оператор
Больше материалов по этой темеНастоящий материал опубликован пользователем Батырханқызы Айсулу Батырханқызы. Инфоурок является информационным посредником и предоставляет пользователям возможность размещать на сайте методические материалы. Всю ответственность за опубликованные материалы, содержащиеся в них сведения, а также за соблюдение авторских прав несут пользователи, загрузившие материал на сайт
Если Вы считаете, что материал нарушает авторские права либо по каким-то другим причинам должен быть удален с сайта, Вы можете оставить жалобу на материал.
Удалить материалВаша скидка на курсы
40%Диагностические и терапевтические возможности работы с коллажем
Признаки уверенного человека. Модель самооценки
Дизайн: использование Adobe Photoshop
Оставьте свой комментарий
Авторизуйтесь, чтобы задавать вопросы.