Created
August 12, 2020 17:02
-
-
Save Sn3akyP3t3/411ac5dbad47e7f6dd49cd51c916bf83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fire | |
import random | |
class ProcessClass(object): | |
def __init__(self): | |
self.pizza = '' | |
def orderUp(self, HowMuchPizza, TipAmount): | |
''' | |
Dishes up the appropriate amount of pizza. | |
Pizza lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse ante nisl, | |
egestas non sem eget, iaculis pharetra diam. Nulla ac felis tincidunt, ullamcorper | |
odio a, tristique justo. Mauris a porttitor elit. Cras varius interdum metus, eu dapibus | |
erat faucibus sed. Integer semper fringilla turpis vel luctus. Proin dictum ipsum sed odio | |
elementum dignissim. Mauris convallis rutrum bibendum. Phasellus malesuada ipsum nec urna | |
ullamcorper congue. Integer vel libero ipsum. | |
Args: | |
HowMuchPizza : string | |
How much pizza do you want?. 0.5 or 1 are the options. If 0.5 don't ask what the delivery guy did with the other half! | |
TipAmount : string | |
Optional - Nobody tips the delivery guy extra so don't feel too bad. We're including this in the cost for delivery now anyway :) | |
''' | |
if(HowMuchPizza < 1.0): | |
if(round(random.random()) == 1): | |
self.secondHalfPizza() | |
else: | |
self.firstHalfPizza() | |
elif HowMuchPizza == 1.0: | |
self.firstHalfPizza() | |
self.secondHalfPizza() | |
else: | |
print("Don't be greedy!") | |
self.gimmePizza() | |
if(TipAmount): | |
print('Woohoo! Much appreciated! I can finally get that game everyone is talking about!') | |
def firstHalfPizza(self): | |
self.pizza += '(' | |
def secondHalfPizza(self): | |
self.pizza += ')' | |
def gimmePizza(self): | |
print(self.pizza) | |
def main(): | |
pc = ProcessClass() | |
fire.Fire(pc.orderUp) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment