0% found this document useful (0 votes)
50 views10 pages

Array-Numpy-Quiz - Attempt Review

The document is a review of an attempt to complete an Array-Numpy quiz. It shows that the student answered all 7 questions correctly, receiving full marks for each question and an overall grade of 9 out of 10. The review provides the questions asked, the student's answers, and the confirmed correct answers to check the student's work.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views10 pages

Array-Numpy-Quiz - Attempt Review

The document is a review of an attempt to complete an Array-Numpy quiz. It shows that the student answered all 7 questions correctly, receiving full marks for each question and an overall grade of 9 out of 10. The review provides the questions asked, the student's answers, and the confirmed correct answers to check the student's work.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

ALGORITMA DAN PEMROGRAMAN SI-45-04 [TNS]


Dashboard / My courses / ISI1E4-SI-45-04 / MG11 Array - Numpy / Array-Numpy-Quiz

Started on Thursday, 12 May 2022, 5:40 PM

State Finished

Completed on Thursday, 12 May 2022, 5:48 PM

Time taken 8 mins 1 sec

Grade 9.00 out of 10.00 (90%)

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 1/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 1
Untuk membuat array dua dimensi b seperti ini
Correct
[[10 20]

Mark 1.00 out of 1.00 [ 3 4]

[ 5 6]]

Caranya:

b= np  .array([[10,20], [3,4]  , [5,6]  ])

print(b)

Your answer is correct.

The correct answer is:


Untuk membuat array dua dimensi b seperti ini
[[10 20]

[ 3 4]

[ 5 6]]

Caranya:

b=[np].array([[10,20],[[3,4]],[[5,6]]])

print(b)

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 2/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 2

Correct # menjumlahkan elemen kedua dan kelima

Mark 1.00 out of 1.00 import numpy  as np

arr = np. array  ([1,2,3,4,5,6])

print( arr[1]  + arr[4]  )

Your answer is correct.

The correct answer is:

# menjumlahkan elemen kedua dan kelima

import [numpy] as np

arr = np.[array] ([1,2,3,4,5,6])

print([arr[1]]+ [arr[4]])

Question 3
untuk ambil elemen ketiga dari array caranya[
Correct
import  numpy as np 

Mark 1.00 out of 1.00


arr = np. array  ([1,2,3,4])

print( arr[2]  )

arr[3] include

Your answer is correct.

The correct answer is:


untuk ambil elemen ketiga dari array caranya[

[import] numpy as [np]

arr = np.[array]([1,2,3,4])

print([arr[2]])

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 3/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 4
Membuat array a dengan tiga elemen
Correct
import numpy  as np

Mark 1.00 out of 1.00


a = np  .array([10,20,30])

print(a)

akan mencetak  output

[10 20 30] 

print(a[0]) akan memberikan 10 

print{a[2]) akan memberikan 30 

print (a[3]} akan memberikan error: index di luar batas 

Your answer is correct.

The correct answer is:


Membuat array a dengan tiga elemen

import [numpy] as np

a = [np].array([10,20,30])

print(a)

akan mencetak  output

[[10 20 30]]

print(a[0]) akan memberikan [10]

print{a[2]) akan memberikan [30]

print (a[3]} akan memberikan [error: index di luar batas]

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 4/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 5
# slicing bisa diartikan mengiris,

Correct
# ambil elemen ke 2 sampai elemen ke 5

Mark 1.00 out of 1.00 import numpy as np

arr = np.array([1, 2, 3, 4, 5, 6, 7])

print( arr[1:6]]  )

arr[[2:5]] arr[[2:6]]

Your answer is correct.

The correct answer is:


# slicing bisa diartikan mengiris,

# ambil elemen ke 2 sampai elemen ke 5

import numpy as np

arr = np.array([1, 2, 3, 4, 5, 6, 7])

print([arr[1:6]]])

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 5/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 6

Correct # menjumlahkan elemen kedua dan ketiga

Mark 1.00 out of 1.00 import numpy  as np

arr = np. array  ([1,2,3,4])

print( arr[1]  + arr[2]  ])

list arr[3]

Your answer is correct.

The correct answer is:

# menjumlahkan elemen kedua dan ketiga

import [numpy] as np

arr = np.[array] ([1,2,3,4])

print([arr[1]]+ [arr[2]]])

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 6/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 7
import numpy as np

Correct c=np.array([[11,22],[33,44],[55,66]])

Mark 1.00 out of 1.00 print( c.shape  )

print(c.size)

print( c.ndim  )

outputnya:

(3, 2) 

6 

[2]

Your answer is correct.

The correct answer is:


import numpy as np

c=np.array([[11,22],[33,44],[55,66]])

print([c.shape])

print(c.size)

print([c.ndim])

outputnya:

[(3, 2)]

[6]

[2]

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 7/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 8

Correct # menjumlahkan elemen pertama dan ketiga

Mark 1.00 out of 1.00 import numpy  as np

arr = np. array  ([1,2,3,4])

print( arr[0]  + arr[2]  )

arr[3] library

Your answer is correct.

The correct answer is:

# menjumlahkan elemen pertama dan ketiga

import [numpy] as np

arr = np.[array] ([1,2,3,4])

print([arr[0]]+ [arr[2]])

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 8/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

Question 9
Isi keluaran dari program ini
Correct
import numpy as np

Mark 1.00 out of 1.00 b=np.array([[10,20],[3,4],[5,6]])

print( b  )

print(b.ndim)

print(b.itemsize)

print(b.dtype)
[[10 20]

[ 3 4]

[ 5 6]]

2 

4 

int32 

Your answer is correct.

The correct answer is:


Isi keluaran dari program ini

import numpy as np

b=np.array([[10,20],[3,4],[5,6]])

print([b])

print(b.ndim)

print(b.itemsize)

print(b.dtype)
[[10 20]

[ 3 4]

[ 5 6]]

[2]

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 9/10
5/12/22, 5:48 PM Array-Numpy-Quiz: Attempt review

[4]

[int32]

Question 10
# slicing bisa diartikan mengiris,

Incorrect
# ambil elemen ke dua sampai akhir

Mark 0.00 out of 1.00 import numpy as np

arr = np.array([1, 2, 3, 4, 5, 6, 7])

print( arr[[1:]]  )

arr[[0:4]] arr[2:]]

Your answer is incorrect.

The correct answer is:


# slicing bisa diartikan mengiris,

# ambil elemen ke dua sampai akhir

import numpy as np

arr = np.array([1, 2, 3, 4, 5, 6, 7])

print([arr[2:]]])

Previous Activity Jump to... Next Activity

https://lms.telkomuniversity.ac.id/mod/quiz/review.php?attempt=4719341&cmid=1780335 10/10

You might also like