初心者向けのPythonのプログラミング問題です。入門編としてチャレンジしてください。Pythonの正答例は以下になります。
問題559
def to_lower(s):
return s.lower()
# 呼び出し例
s = “Hello World”
print(to_lower(s)) # 出力: “hello world”
問題560
def to_upper(s):
return s.upper()
# 呼び出し例
s = “Hello World”
print(to_upper(s)) # 出力: “HELLO WORLD”
問題561
def remove_first_char(s):
return s[1:] if s else s
# 呼び出し例
s = “Python”
print(remove_first_char(s)) # 出力: “ython”



コメント