デビューから3年…本郷愛が素人宅に初突撃!!超ラッキーなM男クンの夢の一
Title:SSERT calculating formulas using Python“`python
x = 10
y = 5
# Addition
sum = x + y
print(‘Addition:’, sum)
# Subtraction
difference = x – y
print(‘Subtraction:’, difference)
# Multiplication
product = x * y
print(‘Multiplication:’, product)
# Division
quotient = x / y
print(‘Division:’, quotient)
# Modulus
remainder = x % y
print(‘Modulus:’, remainder)
# Exponentiation
power = x ** y
print(‘Exponentiation:’, power)
# Mean
mean = (x + y) / 2
print(‘Mean:’, mean)
# Standard deviation
import math
data = [x, y]
n = len(data)
mean = sum(data) / n
variance = sum((x – mean) ** 2 for x in data) / n
std_dev = math.sqrt(variance)
print(‘Standard deviation:’, std_dev)
# Median
data.sort()
n = len(data)
if n % 2 == 0:
median = (data[n // 2 – 1] + data[n // 2]) / 2
else:
median = data[n // 2]
print(‘Median:’, median)
“`