LoginSignup
0
0

【Paiza問題集】標準出力メニュー/【文字列の出力】入力された10個の文字列の出力

Posted at

Paiza問題集

Pythonで回答

標準出力メニュー/【文字列の出力】入力された10個の文字列の出力

Step01 1つの文字列を出力

"""
1つの文字列を出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__string_output_step1
"""

# paizaと出力
print('paiza')

Step02 2つの文字列を出力

"""
2つの文字列を出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__string_output_step2
"""

# paiza learningと1行で出力
print('paiza learning')

Step03 入力された2つの文字列を出力

"""
入力された2つの文字列を出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__string_output_step3
"""

# 文字列を受け取る
str1 = input()
str2 = input()

# 文字列を表示
print(str1)
print(str2)

Step04 入力された10個の文字列を表示

"""
入力された10個の文字列を表示
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__string_output_step4
"""

# 配列を作成
strings = []

# 文字列を受け取り配列に追加
for i in range(10):
    string = input()
    strings.append(string)

# 文字列を表示
for i in range(10):
    if i != 9:
        print(strings[i], end=' ')
    else:
        print(strings[i])

Final問題 【文字列の出力】入力された10個の文字列を出力

"""
【文字列の出力】入力された10個の文字列を出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__string_output_boss
"""

# 文字列を受け取る
strings = input().split(' ')

# 文字列を表示
for i in strings:
    print(i)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0