Từ cơ bản đến nâng cao nhẹ.
Bài 1. Cho hai mảng sau, tính a + b, a - b, a * b, a / b.
import numpy as npChủ đề: toán học, hai con trỏ, sắp xếp, tìm kiếm nhị phân, đệ quy + tổng tiền tố.
Đề bài: Viết hàm kiểm tra một số nguyên không âm n có phải là số Armstrong hay không — tức là tổng các chữ số của nó, mỗi chữ số được nâng lên lũy thừa bằng số lượng chữ số, bằng chính số đó.
(Ví dụ: 153 = 1³ + 5³ + 3³.)
Same topic categories as (math, string, list, binary search, recursion), but with different problems. Each exercise includes: problem statement, constraints, function signature, and assert-based test cases.
Task: Write a function that checks whether a non-negative integer n is a prime number.
Ten real-world exercises using ls, cat, grep, find, and awk, driven from Python with subprocess. Difficulty goes from easy to medium.
Rules for every exercise
["grep", "-c", "ERROR", path]), never shell=True.text=True and capture_output=True unless the exercise says otherwise.Worked solutions with explanations are in SOLUTIONS.md. Every answer there was produced by actually running the code against this dataset, so you can check yourself exactly.
Read DATASET.md first. Several questions are traps that only spring if you skipped it.
Everything a new analyst needs to know before touching the data: where it came from, what each column means, what is wrong with it, and which questions it can and cannot answer.
Green Jaws is a German mail-order nursery specialising in carnivorous plants — Venus
| import base64 | |
| import struct | |
| import turtle | |
| import zlib | |
| screen = turtle.Screen() | |
| screen.setup(940, 640) | |
| screen.bgcolor("#E8ECEB") | |
| screen.title("Lá cờ Turkmenistan") | |
| screen.tracer(0) |