pythonday
Ⅰ python鏂版墜鍏ラ棬鍩虹鑻辨枃絎旇
1銆佸瓧絎︿覆鐨勬搷浣
user錛氱敤鎴
name錛氬悕縐/濮撳悕
attibute錛氬瓧孌/灞炴
Value錛氬
2銆侀噸澶/杞鎹/鏇挎崲/鍘熷嬪瓧絎﹀彿
upper錛氫笂闈
lower錛氫笅闈
capitalize錛氱敤澶у啓瀛楁瘝鍐欐垨鍗板埛
title錛氭爣棰
replace錛氭浛鎹
old錛氭棫鐨
new錛氭柊鐨
count錛氳$畻
swap錛氫簰鎹
case錛氭儏褰
path錛氳礬寰
project錛氶」鐩
test錛氭祴璇
file錛氭枃浠
data錛氭暟鎹
鐩稿叧鎺ㄨ崘錛氥奝ython鏁欑▼銆
3銆佸幓闄/鏌ヨ/璁℃暟
Strip錛氬幓闄
Index錛氭寚鏁
find錛氭煡鎵
count錛氳℃暟
start錛氬紑濮
end錛氱粨鏉
chars錛氬瓧絎
Sub錛氶檮灞
4銆佽幏鍙栬緭鍏/鏍煎紡鍖
input錛氳緭鍏
prompt錛氭彁紺
ID錛氳韓浠借瘉
format錛氭牸寮忓寲
args錛坅rgument錛夛細鍙傛暟
kwargs錛氬叧閿瀛楀弬鏁
year錛氬勾
month錛氭湀
day錛氭棩
5銆佷氦浜掑紡鐜澧冧笌prin杈撳嚭
print錛氭墦鍗/杈撳嚭
coding錛氱紪鐮
syntax錛氳娉
error錛氶敊璇
invalid : 鏃犳晥
identifier錛氬悕縐/鏍囪瘑絎
character錛氬瓧絎
6銆佸叧浜庨泦鍚堢殑涓浜涘熀紜鍗曡瘝
set錛氶泦鍚/璁劇疆
add錛氭坊鍔
update錛氭洿鏂
discard錛氫涪寮
intersection錛氱浉浜
union錛氳仈鍚
difference錛氬樊鏁
symmetric錛氬圭О
in錛氬湪.....閲岄潰
not錛氫笉/涓嶆槸
disjoint錛氫笉鐩鎬氦
subset錛氬瓙闆
superset錛氱埗闆/瓚呴泦
錛氬嶅埗
Ⅱ python編程題
mons = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def get_days(mon, day):
if mon == 1:
return mons[0], day
else:
count = sum(mons[:mon-1])
count = count + day
return mons[mon - 1], count
mon = int(input("請輸入月份:"))
day = int(input("請輸入號數:"))
result = get_days(mon, day)
print("{}月有{}天。".format(mon, result[0]))
print("{}月{}號是該年的第{}天".format(mon, day, result[1]))