file_name = “names.txt”
with open(file_name, mode=”w”) as f:
f.write(“Jiro\n”)
file_name = “names.txt”
with open(file_name, mode=”w”) as f:
f.write(“Jiro\n”)
https://kuchikarasuni.com/blog/onamae-rs-server-ssh/
Pythonをレンタルサーバーで使う方法を現役エンジニアが解説【初心者向け】 | TechAcademyマガジン
import calendar
calendar.setfirstweekday(calendar.SUNDAY)
print(calendar.isleap(2000))
print(calendar.isleap(2001))
import datetime
day1 = datetime.datetime(year=2000, month=4, day=11)
day2 = datetime.datetime(year=2001, month=1, day=1)
delta = datetime.timedelta(days=3, hours=5)
day3 = day1 + delta
print(day3)
import datetime
birthday = datetime.datetime(year=2000, month=4, day=11)
birthday_formatted = birthday.strftime(“%B %d %A, %Y”)
print(birthday_formatted)
import datetime
birthday = datetime.datetime.strptime(“2000-04-11”, “%Y-%m-%d”)
print(birthday)
import math
from math import pi as PI
print(math.cos(math.radians(180)))
import math
print(0.1 * 3 == 0.3)
print(math.isclose(0.1 * 3, 0.3))
using namespace std;
int fibonacci(int n) {
if (n < 3) return 1;
return fibonacci(n – 1) + fibonacci(n – 2);
}
int main() {
for (int n = 1; n <= 10; ++n) {
cout << “f(” << n << “) = ” << fibonacci(n) << endl;
}
}