Loading...
Vietnam Geography App
Loading...
Vietnam Geography App
Biến hóa dữ liệu như một nhà ảo thuật! Bạn sẽ học cách lưu trữ, xử lý và chuyển đổi thông tin với các kiểu dữ liệu đa dạng. Từ số, chuỗi đến logic, mọi thứ đều nằm trong tầm tay bạn.
Tạo chương trình tính toán thông tin cá nhân
# Thu thập thông tin
name = input("Tên: ")
birth_year = int(input("Năm sinh: "))
height_cm = float(input("Chiều cao (cm): "))
# Tính toán
current_year = 2024
age = current_year - birth_year
height_m = height_cm / 100
is_adult = age >= 18
# Hiển thị kết quả
print(f"\n=== THÔNG TIN CÁ NHÂN ===")
print(f"Tên: {name}")
print(f"Tuổi: {age}")
print(f"Chiều cao: {height_m:.2f}m")
print(f"Trạng thái: {'Người lớn' if is_adult else 'Trẻ em'}")
Chương trình xử lý chuỗi văn bản
text = input("Nhập một câu: ")
# Thống kê cơ bản
word_count = len(text.split())
char_count = len(text)
char_no_space = len(text.replace(' ', ''))
# Xử lý văn bản
upper_text = text.upper()
lower_text = text.lower()
title_text = text.title()
reversed_text = text[::-1]
print(f"\n=== PHÂN TÍCH VĂN BẢN ===")
print(f"Số từ: {word_count}")
print(f"Số ký tự (có space): {char_count}")
print(f"Số ký tự (không space): {char_no_space}")
print(f"IN HOA: {upper_text}")
print(f"in thường: {lower_text}")
print(f"Title Case: {title_text}")
print(f"Ngược lại: {reversed_text}")
Form validation trong web apps
Data cleaning và preprocessing
Configuration file processing
User input handling
Data type conversion in APIs
Financial calculations