如何让python一起添加字符串?
下面是我的一小段代码:如何让python一起添加字符串?,python,string,range,Python,String,Range,下面是我的一小段代码: studentName = "" def getExamPoints (total): for i in range (4): total = 0.0 examPoints = input ("Enter exam score for " + studentName + str(i+1) + ": ") total = ????? total = total/.50 total = total * 100 在哪里?
studentName = ""
def getExamPoints (total):
for i in range (4):
total = 0.0
examPoints = input ("Enter exam score for " + studentName + str(i+1) + ": ")
total = ?????
total = total/.50
total = total * 100
在哪里?????我不知道如何让字符串加上四个分数
我稍后输入的学生姓名,要求我在程序的稍后部分使用
examploints=getexamploints(studentName)
而不检查错误输入:
total = 0.0
for i in range (4):
total += int(input ("Enter exam score for " + studentName + str(i+1) + ": "))
total = total/.50
total = total * 100
你试过了吗
total += int(examPoints);