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]))