LoginSignup
2
3

More than 5 years have passed since last update.

「Python」超初心者としてPythonデビュー

Last updated at Posted at 2018-09-11

Pythonデビューしました!

checkflg = False
inputCount = 0
while(not(checkflg)):
    try:
        if inputCount == 0:
            a = int(input("数字を入力してね : "))
        else :
            a = int(input("数字以外のものを入れたよね。もう一回入力してね : "))
        checkflg = True
    except ValueError:
        checkflg = False
        inputCount = inputCount + 1


while(True):
    if a == "8":
        print("ピンポン!")
        break
    else :
        a = input("ブー、不正解だった。再度入力してみてね : ")
2
3
3

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
2
3