从头学Python ,gui求支援,困在这个坑里3天了
coding=utf-8
score = int(input("请输入一个0100整数: "))100整数: 20 **@(_20没办法去除,去除20enter 之后得到反馈 score = int (input ("请输入一个0
请输入一个0100整数: "))100整数:
请输入一个0
Traceback (most recent call last):
File "<pyshell#2>", line 1, in
score = int (input ("请输入一个0~100整数: "))
ValueError: invalid literal for int() with base 10: ''
)
接开头
if score >= 85:
print : ("您真优秀")
if score < 60:
print ("您需要加倍努力!")
您需要加倍努力!
if (socre >= 60) and (score < 85):
print ("您的成绩还可以,仍需要继续努力!")
C:\Users\11849\Desktop\新建文件夹 (2)>1.1.py
File "C:\Users\11849\Desktop\新建文件夹 (2)\1.1.py", line 6
请输入一个0~100整数: 20
^
SyntaxError: invalid decimal literal
# -*- coding: UTF-8 -*-
score = int(input("请输入一个0-100整数: "))
if score >= 85:
print("您真优秀")
elif score < 60:
print("您需要加倍努力!")
elif (score >= 60) and (score < 85):
print("您的成绩还可以,仍需要继续努力!")
反馈如下:
C:\Users\11849\Desktop\新建文件夹 (2)>1.1.py
File "C:\Users\11849\Desktop\新建文件夹 (2)\1.1.py", line 1
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 18:46:30) [MSC v.1929 32 bit (Intel)] on win32
^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
会不会问题出在 score = int(input("请输入一个0100整数: ")) ,只要一会车,直接反馈 请输入一个0100整数: 再回车就是ValueError: invalid literal for int() with base 10: '' 上一步如果输入20 则会在后续直接判定,但是这样无法在CDM通过输入不同数字来判定IF