Beginning (Басы)
2 min
1 min
Checking homework
Үй
тапсырмаларын тексеру
3
min
Eliciting
Бағыттаушы
сұрақ
1
min
|
The teacher will greet the learners and try to create a
positive learning atmosphere: Good morning, good morning to you,
Good morning, good morning, Tell me how are
you?
Greetings, divisions, definition of group
leader.
I divided class into
the 3 groups. List, array, massive
Matching.
remove
|
Алып тастау
|
alphabetize
|
əліпбилік ретпен қою
|
corresponding
|
сəйкес келетін
|
sort
|
сұрыптау
|
ascending
|
Өсу тəртібі
|
descending
|
Кему тəртібі
|
Evaluation.
Star
Evaluation. Star
|
Class123
Personal
work
Interactive
board
|
Middle(Ортасы)
Main text
(Жаңа тақырып
мазмұны)
2
min
4
min
6
min
Practice
Тәжірибе
5
min
5
min
Activity
(Оқушылардың өзіндік
жұмысына арналған тапсырмалар)
4
min
|
In real-world often
tasks have to store rectangular data table. How to write them in
python list?
Nested
Lists
You have seen that an
element in a list can be any sort of object. That includes another
list. A list can contain sublists, which in turn can contain
sublists themselves, and so on to arbitrary
depth.
Show
video
Group
work
-
Input
: arr
= {1, 2, 3, 4, 5, 6}
Output
:
Even Index Product : 15
Odd Index
Product : 48
Explanation: Here, N = 6 so there
will be 3 even index positions and 3 odd index positions in the
array
Even = 1 * 3
* 5 = 15
Odd = 2 * 4
* 6 = 48
-
Input
: arr = {1, 2, 3, 4, 5, 6}
Output
:Even index positions sum 9
Odd index
positions sum 12
Explanation: Here, n = 6 so there
will be 3 even index positions and 3 odd index positions in an
array
Even = 1 + 3
+ 5 = 9
Odd = 2 + 4
+ 6 = 12
Evaluation:
Star
-
Input
: arr = {10, 20, 30, 40, 50, 60, 70}
Output
: Even index positions sum 160
Odd index
positions sum 120
Explanation: Here, n = 7 so there
will be 3 oddindex positions and 4 even index positions in an
array
Even = 10 +
30 + 50 + 70 = 160
Odd = 20 +
40 + 60 = 120
Evaluation.
Star
Practical
work
-
Төменде келтірілген
массив бір жолда бос орындармен бөлінген сандардан тұрады. Екі
өлшемді массивті жолма-жол шығару керек.
arr=[[11,22,33],[44,55,66]]
for i in
range(len(arr)):
for j in
range(len(arr[i])):
print("arr[",i,j,"]=",arr[i][j],end='')
print()
-
Lists and iterables don't
really have dimensions, and even so, sum could work with say, x =
[[1,2,3],[4,5,6]], so try sum(x, []), it just might not do what you
expect.
Списки и итераторы на самом деле не имеют
измерений, и даже в этом случае sum
может работать, скажем,
с x =
[[1,2,3],[4,5,6]], так что попробуйте sum
(x, []),
он просто не может сделать то, что вы ожидаете.
arr=[[1,2,3],[4,5,6]]
sum=0
for row in
arr:
for elem in
row:
sum+=elem
print(sum,end='')
Literacy
1. Where we can use
two-dimensional array?
Give three real-life
examples.
Put the appropriate
words in place:
The problem
is:
Given a
"two-dimensional list" of integers – that is, a list where
each
value in it is a list
of integers – find all the even numbers and sum them
together.
The first one is my
first attempt where I seem to have successfully made it work with 1
list. Then I try to make it work with a 2D list, and this code
gives me an error 'int object is not subscriptible' and I think
it's to do with my while statement. Any help would be appreciated,
thanks!
Star
|
https://youtu.be/VITqU4fMyDA
|