Skip to content

Instantly share code, notes, and snippets.

@benjamincohen1
Created September 23, 2016 03:01
Show Gist options
  • Save benjamincohen1/a5cc8990ceb676f97b93c84c65767889 to your computer and use it in GitHub Desktop.
Save benjamincohen1/a5cc8990ceb676f97b93c84c65767889 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 22 20:56:26 2016
@author: ben
"""
# goal - write a program that finds the average of a group of numbers
# example: given 5, 10, 20, 25 we want to output 15
mysum = float(0)
numbers_to_average = [90, 86, 100]
for x in numbers_to_average:
mysum = mysum + x
average = mysum / len(numbers_to_average)
print average
#now tell student if they pass or fail
# pass is > 60, fail is under
if average == 100:
print 'wow you did a great job'
is_a = average >= 90
elif is_a:
print "A"
elif average >= 80:
print "B"
elif average >= 70:
print "C"
elif average >= 60:
print "D"
else:
print "F"
#x = 9
#if x == 5:
# print 'you are correct'
#else:
# print 'wrong'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment