#46053: Python極限兩行解


chunyutsai97@gmail.com (淳)

學校 : 臺北市立陽明高級中學
編號 : 259744
來源 : [122.116.19.249]
最後登入時間 :
2025-10-05 17:06:03

s, n = input(), int(input())
print(s.capitalize() if n==1 else s.upper() if n==2 else s.title() if n==3 else s.lower())
#46054: Re: Python極限兩行解


leeguanhan0909@gmail.com (李冠翰)

學校 : 高雄市苓雅區復華高級中學國中部
編號 : 276558
來源 : [36.238.189.188]
最後登入時間 :
2025-06-11 22:19:49

s, n = input(), int(input())
print(s.capitalize() if n==1 else s.upper() if n==2 else s.title() if n==3 else s.lower())


一行解

 

(lambda s,n:print(s.capitalize() if n==1 else s.upper() if n==2 else s.title() if n==3 else s.lower()))(input(),int(input()))