Skip to content

Instantly share code, notes, and snippets.

@arutkayb
Created September 3, 2020 18:08
Show Gist options
  • Save arutkayb/79a35e812fc1a602d76bfe202eb360bc to your computer and use it in GitHub Desktop.
Save arutkayb/79a35e812fc1a602d76bfe202eb360bc to your computer and use it in GitHub Desktop.
cookieCountPerServing = 3;
caloriesPerCookie = 160 / cookieCountPerServing;
fatInGramPerCookie = 7 / cookieCountPerServing;
sodiumPerCookieInMgram = 190 / cookieCountPerServing;
carbPerCookieInGram = 25 / cookieCountPerServing;
print("calories per cookie: " + str(caloriesPerCookie));
print("fat in gram per cookie: " + str(fatInGramPerCookie));
print("sodium in mgram per cookie: " + str(sodiumPerCookieInMgram));
print("carb in gram per cookie: " + str(carbPerCookieInGram));
while True:
eatenCookies = int(input("\nHow many cookies you ate? \n"));
print("You consumed " + str(caloriesPerCookie * eatenCookies) + " calories");
print("You consumed " + str(fatInGramPerCookie * eatenCookies) + " gr fat");
print("You consumed " + str(sodiumPerCookieInMgram * eatenCookies) + " mg sodium");
print("You consumed " + str(carbPerCookieInGram * eatenCookies) + " gr carbonhydrate");
if(caloriesPerCookie * eatenCookies > 2000):
print("****Stop eating this damn good cookies you fat cat!****")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment