Basic Python 4 Data Analysis

Quiz
•
Other
•
12th Grade
•
Easy
Ika Anggraeni
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk mendeklarasikan dua variabel a dan b, masing-masing dengan nilai 10 dan 5, lalu hitung jumlah keduanya dan simpan hasilnya dalam variabel c. Pilih jawaban yang benar.
a = 10; b = 5; c = a + b
a = 10; b = 5; c = a / b
a = 10; b = 5; c = a * b
a = 10; b = 5; c = a - b
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk mendeklarasikan variabel x dengan nilai 15, kemudian kurangi 4 dari nilai x dan simpan hasilnya kembali ke dalam x. Pilih jawaban yang benar.
x = 15; x = x / 4
x = 15; x = x * 4
x = 15; x = x + 4
x = 15; x = x - 4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk mendeklarasikan variabel y dengan nilai 20, kemudian kalikan nilai y dengan 3 dan simpan hasilnya dalam variabel z. Pilih jawaban yang benar.
y = 20; z = y / 3
y = 20; z = y * 3
y = 20; z = y - 3
y = 20; z = y + 3
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk mendeklarasikan variabel a dengan nilai 25, kemudian bagi nilai a dengan 5 dan simpan hasilnya dalam variabel b.
Pilih jawaban yang benar:
a = 25; b = a / 5
a = 25; b = a * 5
a = 25; b = a - 5
a = 25; b = a + 5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk membuat grafik garis sederhana menggunakan matplotlib, dengan sumbu-x [1, 2, 3, 4] dan sumbu-y [1, 4, 9, 16].
Pilih jawaban yang benar:
import matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [1, 4, 9, 16] plt.plot(x, y) plt.xlabel('x-axis') plt.ylabel('y-axis') plt.title('Simple Line Plot') plt.show()
import matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [1, 4, 9, 16] plt.scatter(x, y) plt.xlabel('x-axis') plt.ylabel('y-axis') plt.title('Simple Line Plot') plt.show()
import matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [1, 4, 9, 16] plt.hist(x, y) plt.xlabel('x-axis') plt.ylabel('y-axis') plt.title('Simple Line Plot') plt.show()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk membuat grafik batang sederhana menggunakan matplotlib, dengan kategori ['A', 'B', 'C'] dan nilai [10, 20, 15]. Pilih jawaban yang benar.
import matplotlib.pyplot as plt categories = ['A', 'B', 'C'] values = [10, 20, 15] plt.plot(categories, values) plt.xlabel('Categories') plt.ylabel('Values') plt.title('Simple Bar Chart') plt.show()
import matplotlib.pyplot as plt
categories = ['A', 'B', 'C']
values = [10, 20, 15]
plt.scatter(categories, values)
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Simple Bar Chart')
plt.show()
import matplotlib.pyplot as plt
categories = ['A', 'B', 'C']
values = [10, 20, 15]
plt.hist(categories, values)
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Simple Bar Chart')
plt.show()
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Tulis kode Python untuk membuat DataFrame sederhana menggunakan Pandas dengan data berikut:
Name: ['Alice', 'Bob', 'Charlie'] Age: [25, 30, 35] ```
Pilih jawaban yang benar.:
import pandas as pd data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}
df = pd.DataFrame(data) print(df)
import pandas as pd data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}
df = pd.Series(data) print(df)
import pandas as pd
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}
df = pd.DataFrame(data)
print(df.describe())
import pandas as pd
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}
df = pd.Series(data)
print(df.describe())
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tulis kode Python untuk membuat array Numpy dengan nilai [1, 2, 3, 4, 5].
Pilih jawaban yang benar.
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr.sum())
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr.mean())
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr.max())
Similar Resources on Wayground
7 questions
Soal Administrasi Pajak

Quiz
•
12th Grade
10 questions
BP INTERNAL TRAINING ON AML

Quiz
•
1st Grade - Professio...
11 questions
M5S2 - Programación en Multiplataforma

Quiz
•
12th Grade
8 questions
The open economy

Quiz
•
7th Grade - University
12 questions
E-Rapor-1

Quiz
•
12th Grade
10 questions
Intro to data science

Quiz
•
11th - 12th Grade
10 questions
Economic Reforms 199q

Quiz
•
12th Grade
10 questions
Canva

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
6 questions
Rule of Law

Quiz
•
6th - 12th Grade
15 questions
ACT Math Practice Test

Quiz
•
9th - 12th Grade
18 questions
Hispanic Heritage Month

Quiz
•
KG - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
10 questions
Would you rather...

Quiz
•
KG - University
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade