From bcdf1ec9980513da42ea8e4777e5701d3de20327 Mon Sep 17 00:00:00 2001 From: Gi Soong Chee Date: Mon, 5 Feb 2018 13:13:00 +0800 Subject: [PATCH] added comments to provide prompt messages for input --- Practical 2/q08_top2_scores.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Practical 2/q08_top2_scores.py b/Practical 2/q08_top2_scores.py index a1eea00..651775e 100644 --- a/Practical 2/q08_top2_scores.py +++ b/Practical 2/q08_top2_scores.py @@ -9,11 +9,11 @@ score1 = -1 score2 = -1 -studentNo = int(input()) +studentNo = int(input()) # provide prompt message for i in range(studentNo): - studentNames.append(input()) - studentScores.append(int(input())) + studentNames.append(input()) # provide prompt message + studentScores.append(int(input())) # provide prompt message if studentScores[i] > score1 : score2 = score1 @@ -25,4 +25,4 @@ score2s = studentScores[i] index2 = i -print("The student with the highest score({1}) is {0},\nand the student with the second highest score({3}) is {2}.".format(studentNames[index1], score1, studentNames[index2], score2)) \ No newline at end of file +print("The student with the highest score({1}) is {0},\nand the student with the second highest score({3}) is {2}.".format(studentNames[index1], score1, studentNames[index2], score2))