Analysis of examination results. : While : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » While »

 

Analysis of examination results.


passes = 0                  # number of passes
failures = 0                # number of failures
studentCounter = 1          # student counter

while studentCounter <= 10:
   result = raw_input"Enter result (1=pass,2=fail): " )
   result = intresult )   # one exam result

   if result == 1:
      passes = passes + 1
   else:
      failures = failures + 1

   studentCounter = studentCounter + 1

print "Passed", passes
print "Failed", failures

if passes > 8:
   print "Raise tuition"



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» While