Error handling using integers as input

前端 未结 2 486
星月不相逢
星月不相逢 2020-12-02 02:10

Ive set up this program that checks the mark out of 100 for a test. If the user inputs less than 60 it should say fail if more than 59, pass.

mark = int(inp         


        
2条回答
  •  情歌与酒
    2020-12-02 02:46

    try:
       mark = int(input("Please enter the exam mark out of 100 "))
    except ValueError:
       print("\nPlease only use integers")
    

提交回复
热议问题