A Pen by ashitaka1963 on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
def get_next_target_date(date, target_week): | |
week = ['月','火','水','木','金','土','日'] | |
# 曜日を数値型で取得 | |
weekday = date.weekday() | |
# dateから指定した曜日までの加算日数を計算 | |
add_days = 7 - weekday + week.index(target_week) | |
# dateに加算 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=1 | |
b=2 | |
c=3 | |
print(max(a,b,c)) # 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
def connect_str(base_str, add_str): | |
base_str += add_str | |
return base_str | |
WEEKDAY = ['月','火','水','木','金','土','日'] | |
base_str = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 2.2 | |
b = 3.5 | |
print(math.ceil(a)) # 3 | |
print(math.ceil(b)) # 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 文字列 | |
s='abc' | |
print(s[::-1]) # cba | |
# リスト | |
s=['a','b','c'] | |
print(s[::-1]) # ['c', 'b', 'a'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nav{ | |
background: #1F2123; /* ナビゲーションバー全体の背景色 */ | |
} | |
#globalmenu{ | |
width: 60%; /* ナビゲーションバークリック部分の背景色 */ | |
margin: 0 auto 40px; | |
height: 50px; /* 高さ */ | |
padding: 0; | |
list-style-type: none; /* リストのマーク非表示 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=2 | |
for i in range(10): | |
print(n**i, end="") | |
print(" ", end="") | |
print(pow(n,i), end="") | |
print() | |
# 2 2 | |
# 4 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createWindow () { | |
// Create the browser window. | |
win = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
webPreferences: { | |
nodeIntegration: true | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = "ZABCDBABCQ" | |
cnt = s.count("ABC") | |
print(cnt) # 2 |
OlderNewer