Skip to content

Instantly share code, notes, and snippets.

@Ednaordinary
Created July 14, 2023 21:09
Show Gist options
  • Save Ednaordinary/c3bca169df9297f0432d7d7e0a8f8f51 to your computer and use it in GitHub Desktop.
Save Ednaordinary/c3bca169df9297f0432d7d7e0a8f8f51 to your computer and use it in GitHub Desktop.
very basic program for review averages
reviews = []
review = None
while review != "exit":
while True:
review = input("What is the next review? (or exit to exit with list) ")
if review == "exit": break
try:
review = int(review)
if not 5 >= review >= 0: print("Please enter an integer between 0 and 5")
else: break
except: print("Please enter an integer between 0 and 5")
if not review == "exit":
reviews.append(review)
print("The new review average is {:.2f}".format(sum(reviews)/len(reviews)))
print("All reviews: " + str(reviews))
@Ednaordinary
Copy link
Author

what is this why did I put it in a gist ☹️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment