LoginSignup
0
0

More than 1 year has passed since last update.

python – inputがある限りループする

Last updated at Posted at 2022-09-26

無限ループさせておいて入力が空であればループを抜ける。

while True:
    x = input()
    if x == "":
        break
    else:
        print(x)

while line = input(): みたいな簡潔な書き方は出来ない気がした。

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
4

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