등급을 계산하고 "당신은 (90 % 이상이면), b는 80 % 이상이면 b"와 같은 메시지를 내뱉는 프로그램을 만들고 있습니다. .?! 제대로 연산자를 사용하여 누군가가 나에게 적절한 형식을 보여 주시겠습니까 감사부울 연산자 <, >, <= 등
def totals(score_w, score_x, score_y, score_z):
print ("Overall percentage = ", round(score_w + score_x + score_y + score_z), 1)
if round((score_w + score_x + score_y + score_z, 1) > 90.0):
print("Your grade will be at least: A")
elif round((score_w + score_x + score_y + score_z, 1) (< 90) and (>= 80)):
print("Your grade will be at least: B")
elif round((score_w + score_x + score_y + score_z, 1) (< 80) and (>= 70)):
print("Your grade will be at least: C")
'(score_w + score_x + score_y + score_z, 1)'을 변수에 넣으면 항상 반복 할 필요가 없으므로'if'를 재 작성하여 그 변수를 사용할 수 있습니다. – Ryan