Analysis of examination results. : While : Language Basics PYTHON examples


PYTHON examples » Language Basics » 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 examples

 Navioo Language Basics
» While