数学
一、代数
1. 解一元二次方程
题目:解方程 (x^2 - 5x + 6 = 0)。
解答:
from sympy import symbols, Eq, solve
# 定义变量
x = symbols('x')
# 定义方程
equation = Eq(x**2 - 5*x + 6, 0)
# 求解方程
solutions = solve(equation, x)
# 输出解
solutions
2. 求函数的值
题目:求函数 (f(x) = 2x + 3) 在 (x = 4) 时的值。
解答:
# 定义函数
def f(x):
return 2*x + 3
# 求值
value_at_4 = f(4)
# 输出结果
value_at_4
二、几何
1. 求三角形的面积
题目:已知一个三角形的底为 6,高为 4,求其面积。
解答:
# 定义三角形的底和高
base = 6
height = 4
# 计算面积
area = 0.5 * base * height
# 输出面积
area
2. 求圆的周长
题目:已知一个圆的半径为 3,求其周长。
解答:
import math
# 定义圆的半径
radius = 3
# 计算周长
circumference = 2 * math.pi * radius
# 输出周长
circumference
英语
一、语法
1. 现在完成时
题目:用现在完成时填空:I _______ (have) lived in this city for five years.
解答:I have lived.
二、阅读理解
1. 阅读短文,回答问题
短文:The sun is the most important source of energy on Earth. It provides light and heat for living things. Plants use sunlight to make their own food through the process of photosynthesis. This process is essential for the survival of all living organisms.
问题:What is the main idea of the passage?
解答:The main idea of the passage is that the sun is the most important source of energy on Earth and provides light and heat for living things.
物理
一、力学
1. 计算物体的加速度
题目:一个物体从静止开始,在 3 秒内移动了 9 米,求其加速度。
解答:
# 定义位移和时间
displacement = 9
time = 3
# 计算加速度
acceleration = displacement / time**2
# 输出加速度
acceleration
二、电磁学
1. 计算电流
题目:已知电压为 12 伏特,电阻为 6 欧姆,求电流。
解答:
# 定义电压和电阻
voltage = 12
resistance = 6
# 计算电流
current = voltage / resistance
# 输出电流
current
化学
一、元素周期表
1. 查找元素
题目:查找元素周期表中原子序数为 20 的元素。
解答:原子序数为 20 的元素是钙(Ca)。
二、化学方程式
1. 配平化学方程式
题目:配平化学方程式 (H_2 + O_2 \rightarrow H_2O)。
解答:
# 定义化学方程式
equation = "H_2 + O_2 -> H_2O"
# 配平化学方程式
balanced_equation = "2H_2 + O_2 -> 2H_2O"
# 输出配平后的方程式
balanced_equation
